Add per-photo-widget lock (freezes current photo until unlocked)
Build and push server image / test (push) Successful in 33s
Build and push server image / build-and-push (push) Successful in 2m32s
Build and push server image / deploy (push) Successful in 57s

A "Lock this photo" button in the photos widget's dialog toggles
PhotoWidgetConfig.locked, which suppresses both the timer-elapsed
auto-advance and the advance/back button actions until unlocked. The
Layout tab canvas shows a lock badge on any locked photo widget's box.
This commit is contained in:
2026-07-27 21:07:54 +00:00
parent 4e8c6e534b
commit 9911151d8d
14 changed files with 274 additions and 8 deletions
+9 -2
View File
@@ -211,11 +211,18 @@ def get_current(cfg: Frame, assets: list[dict], frame: Frame, in_quiet_hours: bo
/api/queue), so without this an open browser tab polling overnight
would silently advance the current photo on raw elapsed time alone,
even though the device itself is correctly asleep through the
window (see main.py's _effective_refresh_interval_s)."""
window (see main.py's _effective_refresh_interval_s).
cfg.locked suppresses the elapsed-time trigger the same way
in_quiet_hours does -- a locked widget still needs an initial pick
if it somehow has none (an unconfigured widget just locked, or a
changed album), but once it has a current photo the whole point of
locking is that it stops moving on its own until explicitly
unlocked."""
valid_ids = {a["id"] for a in assets}
needs_pick = not cfg.current_asset_id or cfg.current_asset_id not in valid_ids
time_elapsed = (time.time() - cfg.current_asset_set_at) >= frame.refresh_interval_s
stale = needs_pick or (time_elapsed and not in_quiet_hours)
stale = needs_pick or (time_elapsed and not in_quiet_hours and not cfg.locked)
if not stale:
return False
advance_forced(cfg, assets, frame)