From e30ae2460d7c95dc48483505815f8904c16c7d85 Mon Sep 17 00:00:00 2001 From: codey Date: Fri, 14 Mar 2025 13:45:49 -0400 Subject: [PATCH] addl migration related --- lyric_search/sources/cache.py | 2 +- utils/radio_util.py | 76 +++++++++++++++++------------------ 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/lyric_search/sources/cache.py b/lyric_search/sources/cache.py index c210e0f..226acbf 100644 --- a/lyric_search/sources/cache.py +++ b/lyric_search/sources/cache.py @@ -25,7 +25,7 @@ class Cache: self.cache_pre_query: str = "pragma journal_mode = WAL; pragma synchronous = normal;\ pragma temp_store = memory; pragma mmap_size = 30000000000;" - self.sqlite_exts: list[str] = ['/home/singer/api/solibs/spellfix1.cpython-311-x86_64-linux-gnu.so'] + self.sqlite_exts: list[str] = ['/home/api/api/solibs/spellfix1.cpython-311-x86_64-linux-gnu.so'] self.label: str = "Cache" def get_matched(self, matched_candidate: tuple, confidence: int, diff --git a/utils/radio_util.py b/utils/radio_util.py index e6984ed..6247fa2 100644 --- a/utils/radio_util.py +++ b/utils/radio_util.py @@ -22,7 +22,7 @@ class RadioUtil: self.constants = constants self.gpt = gpt.GPT(self.constants) self.ls_uri: str = self.constants.LS_URI - self.sqlite_exts: list[str] = ['/home/singer/api/solibs/spellfix1.cpython-311-x86_64-linux-gnu.so'] + self.sqlite_exts: list[str] = ['/home/api/api/solibs/spellfix1.cpython-311-x86_64-linux-gnu.so'] self.active_playlist_path: Union[str, LiteralString] = os.path\ .join("/usr/local/share", "sqlite_dbs", "track_file_map.db") @@ -146,41 +146,41 @@ class RadioUtil: LIMITED GENRES """ - # db_query: str = """SELECT distinct(LOWER(TRIM(artist)) || " - " || LOWER(TRIM(song))), (TRIM(artist) || " - " || TRIM(song)) AS artistdashsong, id, artist, song, album, 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%"\ - # OR genre LIKE "%dnb%")\ - # GROUP BY artistdashsong ORDER BY RANDOM()""" + db_query: str = """SELECT distinct(LOWER(TRIM(artist)) || " - " || LOWER(TRIM(song))), (TRIM(artist) || " - " || TRIM(song)) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\ + WHERE id >= 74284 AND (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%"\ + OR genre LIKE "%dnb%")\ + GROUP BY artistdashsong ORDER BY RANDOM()""" """ LIMITED TO ONE/SMALL SUBSET OF GENRES @@ -193,8 +193,8 @@ class RadioUtil: LIMITED TO ONE/SOME ARTISTS... """ - db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\ - WHERE (artist LIKE "%color morale%") AND (NOT song LIKE "%%stripped%%" AND NOT song LIKE "%%live%%" AND NOT song LIKE "%%unzipped%%") GROUP BY artistdashsong ORDER BY RANDOM()' + # db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\ + # WHERE (artist LIKE "%lmfao%" OR artist LIKE "%fire from the gods%" OR artist LIKE "%nothing, nowhere%") AND (NOT song LIKE "%%stripped%%" AND NOT song LIKE "%%live%%" AND NOT song LIKE "%%reimagined%%" AND NOT song LIKE "%%alternative%%" AND NOT song LIKE "%%unzipped%%") GROUP BY artistdashsong ORDER BY RANDOM()' async with sqlite3.connect(self.active_playlist_path, timeout=2) as db_conn: