Query-Parameter-Passthrough per URL steuerbar (Checkbox im Edit-Modal), Standard aus, sichtbar via Link-Icon in Playlist
- Neue Config-Felder: passthrough_params (true/false) pro URL-Item - Edit-Modal in admin.html + priority.html mit Checkbox - Player checkt item.passthrough === true vor appendParams() - Default: false (keine Parameter-Übergabe ohne Checkbox) - Link-Icon (ti-link / ti-link-off) in Playlist-Zeile als Status-Indikator - Doku: help.html, README.md, AGENTS.md
This commit is contained in:
21
app.py
21
app.py
@@ -252,7 +252,8 @@ def load_priority_files():
|
||||
"type": "url",
|
||||
"size": "URL",
|
||||
"zoom": url_data.get("zoom", 1.0),
|
||||
"enabled": playlist_item_enabled(item)
|
||||
"enabled": playlist_item_enabled(item),
|
||||
"passthrough": item.get("passthrough_params", False) if isinstance(item, dict) else False
|
||||
})
|
||||
continue
|
||||
|
||||
@@ -980,7 +981,7 @@ def player(site, screen):
|
||||
if is_url(item):
|
||||
url_data = normalize_url(item)
|
||||
if url_data:
|
||||
normal_files.append({"kind": "url", "url": url_data["url"], "zoom": url_data.get("zoom", 1.0), "enabled": True})
|
||||
normal_files.append({"kind": "url", "url": url_data["url"], "zoom": url_data.get("zoom", 1.0), "enabled": True, "passthrough": item.get("passthrough_params", False) if isinstance(item, dict) else False})
|
||||
continue
|
||||
|
||||
if item_name and os.path.exists(os.path.join(folder, item_name)) and allowed_file(item_name):
|
||||
@@ -1010,7 +1011,7 @@ def player(site, screen):
|
||||
if is_url(item):
|
||||
url_data = normalize_url(item)
|
||||
if url_data:
|
||||
prio_files.append({"kind": "url", "url": url_data["url"], "zoom": url_data.get("zoom", 1.0), "enabled": True})
|
||||
prio_files.append({"kind": "url", "url": url_data["url"], "zoom": url_data.get("zoom", 1.0), "enabled": True, "passthrough": item.get("passthrough_params", False) if isinstance(item, dict) else False})
|
||||
continue
|
||||
|
||||
file_path = os.path.join(MEDIA_DIR, "priority", item_name)
|
||||
@@ -1200,7 +1201,8 @@ def admin(site):
|
||||
"type": "url",
|
||||
"size": "URL",
|
||||
"zoom": url_data.get("zoom", 1.0),
|
||||
"enabled": playlist_item_enabled(item)
|
||||
"enabled": playlist_item_enabled(item),
|
||||
"passthrough": item.get("passthrough_params", False) if isinstance(item, dict) else False
|
||||
})
|
||||
continue
|
||||
|
||||
@@ -1608,7 +1610,16 @@ def update_playlist_item(site, screen):
|
||||
for i, item in enumerate(playlist):
|
||||
name = playlist_item_name(item)
|
||||
if name == old_name:
|
||||
playlist[i] = {"url": new_url, "zoom": zoom}
|
||||
updated = {"url": new_url, "zoom": zoom}
|
||||
passthrough = data.get("passthrough", None)
|
||||
if passthrough is not None:
|
||||
updated["passthrough_params"] = bool(passthrough)
|
||||
else:
|
||||
# Bestehenden Wert übernehmen falls vorhanden
|
||||
existing = item.get("passthrough_params") if isinstance(item, dict) else None
|
||||
if existing is not None:
|
||||
updated["passthrough_params"] = existing
|
||||
playlist[i] = updated
|
||||
save_config(config)
|
||||
return jsonify({"success": True})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user