summaryrefslogtreecommitdiff
path: root/manager.py
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2025-06-20 22:32:28 -0500
committerTim Keller <tjk@tjkeller.xyz>2025-06-20 22:32:28 -0500
commitce64f1a42c9570efa75cc2f568e59d683f499bdd (patch)
tree03563a0ce3ce666f465989044120797e5170ff6f /manager.py
parentc9e7eb40fc5f408cc4177763fd4e82a3632388a1 (diff)
downloadimmich-frame-ce64f1a42c9570efa75cc2f568e59d683f499bdd.tar.xz
immich-frame-ce64f1a42c9570efa75cc2f568e59d683f499bdd.zip
config update and more endpoints for api fromtend
Diffstat (limited to 'manager.py')
-rw-r--r--manager.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/manager.py b/manager.py
index b2e101f..27ebab3 100644
--- a/manager.py
+++ b/manager.py
@@ -52,7 +52,7 @@ class PixMan:
config = Config.load(self.configfile) if os.path.exists(self.configfile) else Config()
self.init_web(host, port)
- self.update_config(config)
+ self.replace_config(config)
def init_web(self, host, port):
self.t_flask = Thread(target=self.app.run, kwargs={ "host": host, "port": port })
@@ -78,16 +78,27 @@ class PixMan:
self.display = PixDisplay(self.texture_list)
self.display.main({}) # TODO glut args
- def update_config(self, config):
+ def replace_config(self, config):
#old_config = self.config
self.config = config
# Initialize window if immich parameters are valid
- if config.immich_url and config.immich_api_key and not self.display:
+ if self.config.immich_url and self.config.immich_api_key and not self.display:
self.init_window()
# If all goes well
- config.save(self.configfile)
+ self.config.save(self.configfile)
+ return True
+
+ def update_config(self, **config):
+ self.config.update(**config)
+
+ # Initialize window if immich parameters are valid
+ if self.config.immich_url and self.config.immich_api_key and not self.display:
+ self.init_window()
+
+ # If all goes well
+ self.config.save(self.configfile)
return True