diff --git a/backend/src/app.py b/backend/src/app.py index 1d74893..709118e 100644 --- a/backend/src/app.py +++ b/backend/src/app.py @@ -111,8 +111,8 @@ def queue_next(): if room.playing_idx >= len(room.playing): ## queue ended - # room.renew_queue() - data = {"success": True, "ended": True, "index": room.playing_idx, "queue": room.playing} + room.renew_queue() + data = {"success": True, "ended": True, "index": room.playing_idx, "queue": [asdict(s) for s in room.playing]} state.socketio.emit("new_queue", data, to=str(room.id)) return data @@ -202,7 +202,7 @@ def add_song(): ## add the song in the room if does not exists if song.uuid not in room.songs: room.songs[song.uuid] = (song, 1) # start with one vote - socketio.emit("new_song", {"song": song, "user_score": 1}, to=str(room.id)) + socketio.emit("new_song", {"song": asdict(song), "user_score": 1}, to=str(room.id)) return {"success": True, "song": song} @@ -234,7 +234,7 @@ def post_song_vote(): ## update the song room.songs[song_id] = (song_info[0], song_info[1] + int(request.args["increment"])) - socketio.emit("new_vote", {"song": song_info[0], "user_score": song_info[1]}) + socketio.emit("new_vote", {"song": asdict(song_info[0]), "user_score": song_info[1]}) return {"success": True}