diff --git a/endpoints/radio_util.py b/endpoints/radio_util.py index 5b82cdd..71dd363 100644 --- a/endpoints/radio_util.py +++ b/endpoints/radio_util.py @@ -150,13 +150,39 @@ class RadioUtil: LIMITED GENRES """ - db_query: str = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, genre, file_path, duration FROM tracks\ - WHERE genre IN ("metalcore", "rock", "pop punk", "math rock", "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", "indie pop") GROUP BY artistdashsong ORDER BY RANDOM()' + db_query: str = """SELECT distinct(LOWER(TRIM(artist)) || " - " || LOWER(TRIM(song))) AS artistdashsong, id, artist, song, genre, file_path, duration FROM tracks\ + WHERE genre LIKE "%metalcore%"\ + OR genre LIKE "%rock%"\ + OR genre LIKE "%pop punk%"\ + OR genre LIKE "%math rock%"\ + OR genre LIKE "%punk rock%"\ + OR genre LIKE "%metal%"\ + OR genre LIKE "%punk%"\ + OR genre LIKE "%electronic%"\ + OR genre LIKE "%nu metal%"\ + OR genre LIKE "%EDM%"\ + OR genre LIKE "%post-hardcore%"\ + OR genre LIKE "%pop rock%"\ + OR genre LIKE "%experimental%"\ + OR genre LIKE "%post-punk%"\ + OR genre LIKE "%death metal%"\ + OR genre LIKE "%electronicore%"\ + OR genre LIKE "%hard rock%"\ + OR genre LIKE "%psychedelic rock%"\ + OR genre LIKE "%grunge%"\ + OR genre LIKE "%house%"\ + OR genre LIKE "%dubstep%"\ + OR genre LIKE "%hardcore%"\ + OR genre LIKE "%hair metal%"\ + OR genre LIKE "%horror punk%"\ + OR genre LIKE "%folk punk%"\ + OR genre LIKE "%breakcore%"\ + OR genre LIKE "%post-rock%"\ + OR genre LIKE "%deathcore%"\ + OR genre LIKE "%hardcore punk%"\ + OR genre LIKE "%synthwave%"\ + OR genre LIKE "%trap%"\ + OR genre LIKE "%indie pop%" GROUP BY artistdashsong ORDER BY RANDOM()""" """ LIMITED TO ONE ARTIST... diff --git a/lyric_search/utils.py b/lyric_search/utils.py index a289a31..e4ac70a 100644 --- a/lyric_search/utils.py +++ b/lyric_search/utils.py @@ -119,7 +119,7 @@ class DataUtils: str: Regex scrubbed lyrics """ lyrics = self.scrub_regex_1.sub('', lyrics) - lyrics = self.scrub_regex_2.sub('', lyrics, flags=regex.IGNORECASE) + lyrics = self.scrub_regex_2.sub('', lyrics) lyrics = self.scrub_regex_3.sub('\n', lyrics) # Gaps between verses lyrics = self.scrub_regex_3.sub('', lyrics) return lyrics