Loading configuration files.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-01-17 17:22:55 -05:00
parent 8ae222297a
commit b3d8adec7e

View File

@ -16,6 +16,17 @@ Class {
#category : #VideoWeb #category : #VideoWeb
} }
{ #category : #accessing }
Invidious class >> configFile [
| configFolder |
configFolder := (FileLocator userData / 'Mutabit' / 'VideoWeb') ensureCreateDirectory.
^ configFolder / 'config.ston'
]
{ #category : #accessing }
Invidious class >> configFolder [
]
{ #category : #accessing } { #category : #accessing }
Invidious class >> default: anObject [ Invidious class >> default: anObject [
default := anObject default := anObject
@ -40,6 +51,11 @@ Invidious class >> instancesWithAPIEnabled [
^ self instances select: [ :instance | instance api = true ] ^ self instances select: [ :instance | instance api = true ]
] ]
{ #category : #accessing }
Invidious class >> loadConfiguration [
^ self default: (STON fromString: self configFile contents)
]
{ #category : #accessing } { #category : #accessing }
Invidious class >> rawInstances [ Invidious class >> rawInstances [
^ STON ^ STON