Fix testini's smarcio

This commit is contained in:
Leonardo Segala 2025-08-02 04:17:20 +02:00
parent e01d52f7f4
commit 72ceb0f8dc

View file

@ -111,8 +111,8 @@ def queue_next():
if room.playing_idx >= len(room.playing): if room.playing_idx >= len(room.playing):
## queue ended ## queue ended
# room.renew_queue() room.renew_queue()
data = {"success": True, "ended": True, "index": room.playing_idx, "queue": room.playing} 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)) state.socketio.emit("new_queue", data, to=str(room.id))
return data return data
@ -202,7 +202,7 @@ def add_song():
## add the song in the room if does not exists ## add the song in the room if does not exists
if song.uuid not in room.songs: if song.uuid not in room.songs:
room.songs[song.uuid] = (song, 1) # start with one vote 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} return {"success": True, "song": song}
@ -234,7 +234,7 @@ def post_song_vote():
## update the song ## update the song
room.songs[song_id] = (song_info[0], song_info[1] + int(request.args["increment"])) 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} return {"success": True}