diff --git a/src/get_playlists_v2.py b/src/get_playlists_v2.py index 5e530dd..8e039c9 100644 --- a/src/get_playlists_v2.py +++ b/src/get_playlists_v2.py @@ -454,6 +454,18 @@ def update_playlist_if_needed(config, playlist_dir, media_dir): return playlist_file else: logger.info("✓ Playlist is up to date") + # Even when the playlist version matches, ensure media files exist locally. + # The media folder might be empty (e.g. fresh install or deleted files). + logger.info("📥 Checking for missing media files...") + ssl_manager = auth.ssl_manager if config.get('use_https', True) else None + server_url = auth.auth_data.get('server_url', '') + downloaded = download_media_files( + server_data.get('playlist', []), media_dir, ssl_manager, server_url + ) + if downloaded: + server_data['playlist'] = downloaded + # Re-save playlist with updated URLs if needed + save_playlist(server_data, playlist_dir) return playlist_file except Exception as e: diff --git a/src/main.py b/src/main.py index ce16dd0..1449a94 100644 --- a/src/main.py +++ b/src/main.py @@ -1522,6 +1522,9 @@ class SignagePlayer(Widget): def _on_video_eos(self, instance): """Callback when video reaches end of stream""" Logger.debug("SignagePlayer: Video finished playing (EOS)") + # Unschedule any pending timer and advance to next media + Clock.unschedule(self.next_media) + Clock.schedule_once(self.next_media, 0.5) def _on_video_loaded(self, instance, value): """Callback when video is loaded - log video information""" diff --git a/windows/development-track.md b/windows/development-track.md index 72b7267..12cb0c9 100644 --- a/windows/development-track.md +++ b/windows/development-track.md @@ -99,12 +99,22 @@ - **Files:** `windows/run_win.py`, `windows/cef_browser.py` ### [BUG-008] Intro video and media files not found at runtime -- **Status:** 🟡 **Known** 2026-07-24 +- **Status:** ✅ **Fixed** 2026-07-24 - **Symptom:** `[ERROR] [Image] Error loading <...intro1.mp4>` — intro broken. Also `❌ Media file not found` for playlist items. -- **Root cause:** Media files are not bundled in .exe — must be downloaded - from server. Player connects (v16 received) but hasn't downloaded files. -- **Fix:** Verify server is sending media content and player downloads it. +- **Root cause:** Media download only ran when `server_version > local_version`. + When versions matched (v16 == v16), `download_media_files` was never called + → media folder stayed empty. +- **Fix:** Added download check in the "up to date" branch — now downloads + missing media files even when playlist version hasn't changed. + +### [BUG-009] Video never advances to next item (EOS handler empty) +- **Status:** ✅ **Fixed** 2026-07-24 +- **Symptom:** Video plays but never advances to the next playlist item. +- **Root cause:** `_on_video_eos()` callback was a stub — just logged + "Video finished playing (EOS)" but never called `next_media()`. +- **Fix:** Added `Clock.unschedule(self.next_media)` + `Clock.schedule_once` + to advance after 0.5s when a video reaches end of stream. ---