summaryrefslogtreecommitdiff
path: root/manager.py
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2025-06-24 18:34:07 -0500
committerTim Keller <tjk@tjkeller.xyz>2025-06-24 18:34:07 -0500
commit0b0c1978c4f7b57a240575de56b8e40d29c3c219 (patch)
tree4bc4c86175efc86f2a3564b78b6fa4ef05ed4407 /manager.py
parent8fa092b81aa09239e15b44e2002c7d18d3f4244b (diff)
downloadimmich-frame-0b0c1978c4f7b57a240575de56b8e40d29c3c219.tar.xz
immich-frame-0b0c1978c4f7b57a240575de56b8e40d29c3c219.zip
live reload window display config
Diffstat (limited to 'manager.py')
-rw-r--r--manager.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/manager.py b/manager.py
index 27ebab3..8f7ed80 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.replace_config(config)
+ self.update_config(config, replace=True)
def init_web(self, host, port):
self.t_flask = Thread(target=self.app.run, kwargs={ "host": host, "port": port })
@@ -78,24 +78,17 @@ class PixMan:
self.display = PixDisplay(self.texture_list)
self.display.main({}) # TODO glut args
- def replace_config(self, config):
- #old_config = self.config
- self.config = config
+ def update_config(self, config, replace=False):
+ if replace:
+ self.config = config
+ else:
+ 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
-
- 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()
+ self.display.update_config()
# If all goes well
self.config.save(self.configfile)