addl migration related

This commit is contained in:
codey 2025-03-14 13:45:49 -04:00
parent c9d0edf77d
commit e30ae2460d
2 changed files with 39 additions and 39 deletions

View File

@ -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,

View File

@ -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: