From 447198e0d19d583ee662c361ac7a73c9f62c4f3a Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Tue, 7 Apr 2026 10:03:12 -0700 Subject: [PATCH] Updates. --- immich_photo_renderer.py | 52 +++++++++++++++++--------- kiosk.py | 80 +++++++++++++++++++++++----------------- 2 files changed, 80 insertions(+), 52 deletions(-) diff --git a/immich_photo_renderer.py b/immich_photo_renderer.py index be6e5db..5590154 100644 --- a/immich_photo_renderer.py +++ b/immich_photo_renderer.py @@ -4,6 +4,7 @@ import datetime import os import random import re +import time from typing import Any, Dict, List, Optional, Set from scottutilz import immich @@ -84,8 +85,9 @@ def get_layout_class(asset: dict[str, Any]) -> str: orientation = int(orientation) if orientation in [6, 8]: aspect_ratio = float(1) / aspect_ratio + (width, height) = (height, width) - if aspect_ratio > 1.5: + if aspect_ratio > 1.6 and width > height: return 'panorama_mode' return 'standard_mode' @@ -154,6 +156,8 @@ class immich_photo_renderer(renderer.abstaining_renderer): jpeg = self.immich_cli.get_asset_thumbnail(selected_uuid, size="fullsize") with open("/var/www/kiosk/pages/mfs/current.jpeg", "wb") as f: f.write(jpeg) + f.flush() + os.fsync(f.fileno()) except Exception: print("Failed to get image!") return False @@ -222,6 +226,7 @@ class immich_photo_renderer(renderer.abstaining_renderer): {album_name} """ + cache_buster = int(time.time()) with file_writer.file_writer("photo_33_3600.html") as f: f.write( f""" @@ -263,20 +268,19 @@ class immich_photo_renderer(renderer.abstaining_renderer): }} .standard_mode .photo-pane {{ flex: 1; - max-width: 80vw; /* Limit width to 80% */ + max-width: 80vw; }} .panorama_mode .photo-pane {{ - flex: 1; - height: 70vh; /* Limit height to 70% */ - width: 100vw; + flex: 1 1 auto; + max-height: 75vh; min-height: 0; + width: 100vw; }} .photo-pane img {{ max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 0 50px rgba(0,0,0,0.5); - border-radius: 4px; }} /* --- Info Pane Logic --- */ @@ -301,12 +305,12 @@ class immich_photo_renderer(renderer.abstaining_renderer): flex-direction: column; }} .panorama_mode .info-pane {{ - flex: 0 0 var(--bottom-h); - flex-direction: row; + flex: 0 1 auto; + min-height: 20vh; + display: flex; + /* flex-direction: row; */ align-items: center; - border-top: 2px solid #333; - gap: 2vw; /* Use relative gap */ - padding: 0 3vw; + padding: 2vh 3vw; }} /* --- Typography & Elements --- */ @@ -321,10 +325,10 @@ class immich_photo_renderer(renderer.abstaining_renderer): margin-bottom: 2vh; }} .panorama_mode .description {{ - flex: 1; - font-size: 1.8rem; + flex: 1.5; + font-size: clamp(1.2rem, 2.8vh, 2.5rem); + overflow: visible; margin: 0; - font-size: clamp(1.2rem, 2.5vh, 2.2rem); padding-right: 2vw; min-width: 0; /* Allows text to truncate/wrap properly */ }} @@ -383,7 +387,7 @@ class immich_photo_renderer(renderer.abstaining_renderer): .panorama_mode .album-section-title {{ writing-mode: vertical-lr; transform: rotate(180deg); - margin: 0; + margin: 10px; }} .album-grid {{ @@ -393,11 +397,12 @@ class immich_photo_renderer(renderer.abstaining_renderer): .standard_mode .album-grid {{ display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); + justify-content: flex-end; }} .panorama_mode .album-grid {{ - flex: 1; + flex: 1.3; flex-direction: row; - justify-content: flex-start; + justify-content: center; }} .album-card {{ display: flex; @@ -421,12 +426,22 @@ class immich_photo_renderer(renderer.abstaining_renderer): /* white-space: nowrap; overflow: hidden; text-overflow: ellipsis; */ + + /* Fix #1: Force long words like 'AdobeLightroom' to break */ + word-break: break-word; + overflow-wrap: break-word; + + /* Fix #2: Multi-line truncation (The "Best of Both Worlds") */ + display: -webkit-box; + -webkit-line-clamp: 2; /* Show exactly 3 lines, then dots */ + -webkit-box-orient: vertical; + overflow: hidden; }}
- Current kiosk photo + Current kiosk photo
@@ -443,6 +458,7 @@ class immich_photo_renderer(renderer.abstaining_renderer): {date.strftime("%B %-d, %Y")}
+
Appears In
{album_html} diff --git a/kiosk.py b/kiosk.py index 55b1492..308c649 100755 --- a/kiosk.py +++ b/kiosk.py @@ -395,7 +395,7 @@ def emit_wrapped( """ Kitchen Kiosk - +