summaryrefslogtreecommitdiff
path: root/manager.py
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2025-06-24 18:56:53 -0500
committerTim Keller <tjk@tjkeller.xyz>2025-06-24 18:56:53 -0500
commit2f03f39e24053377dce108e45fde13ccd1e0ae22 (patch)
treeab7aca31e7433a417b54febf511a76af02c9df7a /manager.py
parent0b0c1978c4f7b57a240575de56b8e40d29c3c219 (diff)
downloadimmich-frame-2f03f39e24053377dce108e45fde13ccd1e0ae22.tar.xz
immich-frame-2f03f39e24053377dce108e45fde13ccd1e0ae22.zip
window can now handle no selected albums
Diffstat (limited to 'manager.py')
-rw-r--r--manager.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/manager.py b/manager.py
index 8f7ed80..918a0c4 100644
--- a/manager.py
+++ b/manager.py
@@ -1,6 +1,7 @@
import os
import sys
import signal
+import copy
from threading import Thread
from OpenGL.GLUT import glutLeaveMainLoop
@@ -49,10 +50,10 @@ class PixMan:
signal.signal(signal.SIGINT, PixMan.handle_sigint)
self.configfile = configfile
- config = Config.load(self.configfile) if os.path.exists(self.configfile) else Config()
+ self.config = Config.load(self.configfile) if os.path.exists(self.configfile) else Config()
self.init_web(host, port)
- self.update_config(config, replace=True)
+ self.update_config(self.config, replace=True)
def init_web(self, host, port):
self.t_flask = Thread(target=self.app.run, kwargs={ "host": host, "port": port })
@@ -67,7 +68,7 @@ class PixMan:
# Initialize texture list
change_callback = lambda d: self.socketio.emit("seek", d)
- album_keys = [ "38617851-6b57-44f1-b5f7-82577606afc4" ]
+ album_keys = [ ]
self.texture_list = LazyCachingTextureList(album_keys, max_cache_items=self.config.max_cache_assets, change_callback=change_callback)
# Begin downloading images
@@ -79,6 +80,7 @@ class PixMan:
self.display.main({}) # TODO glut args
def update_config(self, config, replace=False):
+ oldconfig = copy.deepcopy(self.config)
if replace:
self.config = config
else:
@@ -90,6 +92,10 @@ class PixMan:
self.display.update_config()
+ if oldconfig.album_list != self.config.album_list:
+ self.texture_list = LazyCachingTextureList(album_keys)
+ self.display.update_textures()
+
# If all goes well
self.config.save(self.configfile)
return True