diff --git a/utils/radio_util.py b/utils/radio_util.py index a95830e..469b9d4 100644 --- a/utils/radio_util.py +++ b/utils/radio_util.py @@ -117,7 +117,7 @@ class RadioUtil: raise RadioException("No query provided") try: search_query: str = ( - 'SELECT id, artist, song, (artist || " - " || song) AS artistsong, album, genre, file_path, duration FROM tracks\ + 'SELECT id, artist, song, (artist || " - " || song) AS artistsong, album, file_path, duration FROM tracks\ WHERE editdist3((lower(artist) || " " || lower(song)), (? || " " || ?))\ <= 410 ORDER BY editdist3((lower(artist) || " " || lower(song)), ?) ASC LIMIT 1' ) @@ -148,10 +148,12 @@ class RadioUtil: push_obj: dict = { "id": result["id"], "uuid": str(uuid().hex), - "artist": result["artist"].strip(), - "song": result["song"].strip(), + "artist": double_space.sub(" ", result["artist"].strip()), + "song": double_space.sub(" ", result["song"].strip()), "artistsong": result["artistsong"].strip(), - "genre": result["genre"], + "genre": await self.get_genre( + double_space.sub(" ", result["artist"].strip()) + ), "file_path": result["file_path"], "duration": result["duration"], }