From a9daeb3f8809537d90450f0f60365497d758586d Mon Sep 17 00:00:00 2001 From: Leonardo Moreira Date: Tue, 3 Dec 2024 15:09:56 -0300 Subject: [PATCH] fix: File was being deleted even if it was in queue --- pikaraoke/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pikaraoke/app.py b/pikaraoke/app.py index 64056475..26458663 100644 --- a/pikaraoke/app.py +++ b/pikaraoke/app.py @@ -441,7 +441,8 @@ def start_song(): def delete_file(): if "song" in request.args: song_path = request.args["song"] - if song_path in k.queue: + exists = any(item.get('file') == song_path for item in k.queue) + if exists: flash( "Error: Can't delete this song because it is in the current queue: " + song_path, "is-danger",