diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2025-12-09 22:16:48 -0600 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2025-12-09 22:16:57 -0600 |
| commit | 3e7fdfb6c8a50c59ac933f701526ad1815dded92 (patch) | |
| tree | d2c699ff93e23d0fe45845a4c2dc05d820ec317b /src/server/settings.py | |
| parent | 39738b84e9164b0f2d01f22440548c4393160013 (diff) | |
| download | immich-frame-3e7fdfb6c8a50c59ac933f701526ad1815dded92.tar.xz immich-frame-3e7fdfb6c8a50c59ac933f701526ad1815dded92.zip | |
refactor codebase. Reorganize file structure. Replace webpack for vite. Setup setuptools for application. Move closer to distributable appv0.3.0
Diffstat (limited to 'src/server/settings.py')
| -rw-r--r-- | src/server/settings.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/server/settings.py b/src/server/settings.py new file mode 100644 index 0000000..ce76e82 --- /dev/null +++ b/src/server/settings.py @@ -0,0 +1,32 @@ +from dataclasses import dataclass, asdict, field +import json + + +@dataclass +class Config: + # Immich server + immich_url: str = "" + immich_api_key: str = "" + # Display + image_duration: float = 10.0 + transition_duration: float = 0.5 + max_framerate: float = 30.0 + auto_transition: bool = True + display_size: str = "preview" # 'fullsize', 'preview', 'thumbnail' + # Cache + max_cache_assets: int = 100 + # Albums data + album_list: list[str] = field(default_factory=list) + + @classmethod + def load(cls, filepath): + with open(filepath, "r") as fp: + return cls(**json.load(fp)) + + 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) |
