summaryrefslogtreecommitdiff
path: root/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'settings.py')
-rw-r--r--settings.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/settings.py b/settings.py
index f11e930..e6b3df8 100644
--- a/settings.py
+++ b/settings.py
@@ -3,12 +3,6 @@ import json
@dataclass
-class AlbumList:
- name: str
- album_keys: list[str]
-
-
-@dataclass
class Config:
# Immich server
immich_url: str = ""
@@ -22,11 +16,7 @@ class Config:
# Cache
max_cache_assets: int = 100
# Albums data
- album_lists: list[AlbumList] = field(default_factory=list)
- album_list_selected: int = None
-
- def __post_init__(self):
- self.album_lists = [ AlbumList(*a) for a in self.album_lists ]
+ album_list: list[str] = field(default_factory=list)
def __dict__(self):
return asdict(self)
@@ -39,3 +29,7 @@ class Config:
def save(self, filepath):
with open(filepath, "w") as fp:
json.dump(asdict(self), fp, indent=2)
+
+ def update(self, **config):
+ for key, value in config.items():
+ setattr(self, key, value)