Add weblink playlist support and fix offline playback recursion

- get_playlists_v2: pass through weblink items without download, preserve type
- main.py: render weblink items fullscreen via Chromium kiosk overlay with cleanup on next/pause/stop
- main.py: fix unbounded recursion when playlist media is missing/invalid by scheduling retries via Clock (keeps standard playlist cycling offline)
- docs: add PLAYER_WEBLINK_INTEGRATION.md
This commit is contained in:
Kiwy Signage Player
2026-06-28 13:46:29 +03:00
parent 2c31589787
commit abbd51a787
3 changed files with 413 additions and 21 deletions
+15
View File
@@ -243,6 +243,20 @@ def download_media_files(playlist, media_dir, ssl_manager=None, server_url=None)
file_name = media.get('file_name', '')
file_url = media.get('url', '')
duration = media.get('duration', 10)
item_type = media.get('type', '')
# Web-link items have no file to download — pass the link through unchanged.
if item_type == 'weblink':
logger.info(f"🔗 Web link item (no download): {file_url}")
updated_playlist.append({
'file_name': file_name,
'type': 'weblink',
'url': file_url, # keep the original web address (not a local path)
'duration': duration,
'edit_on_player': False,
})
continue
local_path = os.path.join(media_dir, file_name)
logger.info(f"📥 Preparing to download {file_name}...")
@@ -307,6 +321,7 @@ def download_media_files(playlist, media_dir, ssl_manager=None, server_url=None)
# (it might already exist or be available later)
updated_media = {
'file_name': file_name,
'type': item_type, # Preserve media type (image/video/...)
'url': os.path.relpath(local_path, os.path.dirname(media_dir)),
'duration': duration,
'edit_on_player': media.get('edit_on_player', False) # Preserve edit_on_player flag