adding to showplan
This commit is contained in:
parent
bd2b5b41a6
commit
9536bf7c07
1 changed files with 6 additions and 3 deletions
|
@ -30,13 +30,16 @@ async def websocket_handler(websocket, path):
|
|||
elif data["command"] == "LOAD":
|
||||
channel_to_q[channel].put("LOAD:" + str(data["weight"]))
|
||||
elif data["command"] == "ADD":
|
||||
print(data)
|
||||
new_item: Dict[str, any] = {
|
||||
"channel_weight": int(data["weight"]),
|
||||
"channel_weight": int(data["newItem"]["weight"]),
|
||||
"filename": "dev\\test.mp3",
|
||||
"title": data["title"],
|
||||
"artist": None
|
||||
"title": data["newItem"]["title"],
|
||||
"artist": data["newItem"]["artist"] if "artist" in data["newItem"].keys() else None
|
||||
}
|
||||
channel_to_q[channel].put("ADD:" + json.dumps(new_item))
|
||||
elif data["command"] == "REMOVE":
|
||||
channel_to_q[channel].put("REMOVE:" + str(data["weight"]))
|
||||
|
||||
await asyncio.wait([conn.send(message) for conn in baps_clients])
|
||||
|
||||
|
|
Loading…
Reference in a new issue