From a7374d6d94a521f8df4b5d87c3f1fb2f8ecaa779 Mon Sep 17 00:00:00 2001 From: Simone Tesini Date: Sat, 2 Aug 2025 10:47:49 +0200 Subject: [PATCH] add tag filtre --- backend/src/app.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/src/app.py b/backend/src/app.py index 436d5d7..ac1dfaa 100644 --- a/backend/src/app.py +++ b/backend/src/app.py @@ -222,6 +222,15 @@ def add_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 if song.uuid not in room.songs: room.songs[song.uuid] = (song, 1) # start with one vote