From 2c368aaf1a9e1bb30dce02d261a703dc5e005e62 Mon Sep 17 00:00:00 2001 From: codey Date: Tue, 11 Feb 2025 16:53:42 -0500 Subject: [PATCH] bugfix- not storing id for search_playlist --- endpoints/radio.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/endpoints/radio.py b/endpoints/radio.py index 8812ade..f1d3a47 100644 --- a/endpoints/radio.py +++ b/endpoints/radio.py @@ -187,7 +187,7 @@ class Radio(FastAPI): try: search_artist = None search_song = None - search_query = 'SELECT id, artist, song, (artist || " - " || song) AS artistsong, file_path, duration FROM tracks\ + search_query = 'SELECT id, artist, song, (artist || " - " || song) AS artistsong, genre, file_path, duration FROM tracks\ WHERE editdist3((lower(artist) || " " || lower(song)), (? || " " || ?))\ <= 410 ORDER BY editdist3((lower(artist) || " " || lower(song)), ?) ASC LIMIT 1' if artistsong: @@ -210,10 +210,12 @@ class Radio(FastAPI): if not result: return False pushObj = { + 'id': result['id'], 'uuid': str(uuid().hex), 'artist': result['artist'].strip(), 'song': result['song'].strip(), 'artistsong': result['artistsong'].strip(), + 'genre': result['genre'], 'file_path': result['file_path'], 'duration': result['duration'], } @@ -236,7 +238,7 @@ class Radio(FastAPI): """ db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, genre, file_path, duration FROM tracks\ - WHERE genre IN ("hip hop", "metalcore", "pop punk", "punk rock", "metal", "punk", "electronic", "nu metal", "EDM",\ + WHERE genre IN ("metalcore", "pop punk", "punk rock", "metal", "punk", "electronic", "nu metal", "EDM",\ "post-hardcore", "pop rock", "experimental", "post-punk", "death metal", "electronicore", "hard rock", "psychedelic rock",\ "grunge", "house", "dubstep", "hardcore", "hair metal", "horror punk", "folk punk", "breakcore",\ "post-rock", "deathcore", "hardcore punk", "synthwave", "trap") GROUP BY artistdashsong ORDER BY RANDOM()'