0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-26 13:52:00 +01:00
This commit is contained in:
2025-12-09 20:30:48 +01:00
parent 5230262fe5
commit e55d5462b5
2 changed files with 1 additions and 3 deletions

View File

@@ -127,7 +127,7 @@
ws.addEventListener("open", () => {
document.getElementById("server-status").textContent = "connected";
reconnectDelay = 1000;
ws.send(JSON.stringify({action:"request_state"}));
// ws.send(JSON.stringify({action:"request_state"}));
// also request a top-play list if you want:
// ws.send(JSON.stringify({action:"get_toplay"}));
});

View File

@@ -68,8 +68,6 @@ async def ws_handler(websocket: ServerConnection, shared_data: dict, imc_q: mult
}
except Exception: payload = {}
await websocket.send(json.dumps({"event": "state", "data": payload}))
elif action == "request_dirs":
await websocket.send(json.dumps({"event": "dirs", "files": [i.name for i in list(MAIN_PATH_DIR.iterdir()) if i.is_file()], "dirs": [i.name for i in list(MAIN_PATH_DIR.iterdir()) if i.is_dir()], "base": str(MAIN_PATH_DIR)}))
else:
await websocket.send(json.dumps({"error": "unknown action"}))