0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-26 13:52:00 +01:00

de-select

This commit is contained in:
2025-12-27 21:54:25 +01:00
parent 82e8423178
commit 748913552e
3 changed files with 17 additions and 3 deletions

View File

@@ -45,9 +45,10 @@ async def ws_handler(websocket: ServerConnection, shared_data: dict, imc_q: mult
await websocket.send(json.dumps({"status": "ok", "action": "skip_requested"}))
elif action == "add_to_toplay":
songs = msg.get("songs")
at_top = msg.get("top", False)
if not isinstance(songs, list): await websocket.send(json.dumps({"error": "songs must be a list"}))
else:
imc_q.put({"name": "activemod", "data": {"action": "add_to_toplay", "songs": songs}})
imc_q.put({"name": "activemod", "data": {"action": "add_to_toplay", "songs": songs, "at_top": at_top}})
await websocket.send(json.dumps({"status": "ok", "message": f"{len(songs)} song(s) queued"}))
result = await get_imc("activemod", {"action": "get_toplay"})