summaryrefslogtreecommitdiff
path: root/window.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 /window.py
parent0b0c1978c4f7b57a240575de56b8e40d29c3c219 (diff)
downloadimmich-frame-2f03f39e24053377dce108e45fde13ccd1e0ae22.tar.xz
immich-frame-2f03f39e24053377dce108e45fde13ccd1e0ae22.zip
window can now handle no selected albums
Diffstat (limited to 'window.py')
-rw-r--r--window.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/window.py b/window.py
index 0bb5b3d..5387930 100644
--- a/window.py
+++ b/window.py
@@ -35,6 +35,10 @@ class PixDisplay:
self.transition_duration = config.transition_duration
self.auto_transition = config.auto_transition
+ def update_textures(self, textures):
+ self.textures = textures
+ self.current_texture_index = 0
+
@property
def max_framerate(self):
#return int(1000/int(1000/self.frame_time))
@@ -68,9 +72,10 @@ class PixDisplay:
self.last_time = current_time
if not self.tex or not self.tex.initialized or not self.tex.id:
- self.increment_texture_index(0)
+ if self.textures.asset_count > 0:
+ self.increment_texture_index(0)
# Draw black window if no textures are available
- if not self.tex.id:
+ if not self.tex or not self.tex.id:
glClearColor(0.0, 0.0, 0.0, 1.0)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glutSwapBuffers()