Merge branch 'main' of https://repos.hackathon.bz.it/2025-summer/team-1
This commit is contained in:
commit
88f34c6257
1 changed files with 9 additions and 0 deletions
|
@ -222,6 +222,15 @@ def add_song():
|
||||||
|
|
||||||
add_song_in_db(song)
|
add_song_in_db(song)
|
||||||
|
|
||||||
|
if len(room.tags) > 0:
|
||||||
|
tag_ok = False
|
||||||
|
for tag in song.tags:
|
||||||
|
if tag in room.tags:
|
||||||
|
tag_ok = True
|
||||||
|
|
||||||
|
if not tag_ok:
|
||||||
|
return error("Song genre does not belong to this room")
|
||||||
|
|
||||||
## 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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue