This commit is contained in:
2025-02-26 20:47:29 -05:00
parent 5d4335f92d
commit 1ab5adfc2d
4 changed files with 11 additions and 8 deletions

View File

@ -21,7 +21,7 @@ class RadioUtil:
def __init__(self, constants) -> None:
self.constants = constants
self.gpt = gpt.GPT(self.constants)
self.ls_uri: str = "http://10.10.10.101:29000"
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.active_playlist_path: Union[str, LiteralString] = os.path\
.join("/usr/local/share",
@ -146,7 +146,7 @@ class RadioUtil:
"""
db_query: str = """SELECT distinct(LOWER(TRIM(artist)) || " - " || LOWER(TRIM(song))), (TRIM(artist) || " - " || TRIM(song)) AS artistdashsong, id, artist, song, genre, file_path, duration FROM tracks\
WHERE genre LIKE "%metalcore%"\
WHERE (genre LIKE "%metalcore%"\
OR genre LIKE "%rock%"\
OR genre LIKE "%pop punk%"\
OR genre LIKE "%math rock%"\
@ -178,15 +178,16 @@ class RadioUtil:
OR genre LIKE "%synthwave%"\
OR genre LIKE "%trap%"\
OR genre LIKE "%indie pop%"\
OR genre LIKE "untagged"\
GROUP BY artistdashsong ORDER BY RANDOM()"""
OR genre LIKE "%dnb%"\
OR genre LIKE "untagged")\
GROUP BY artistdashsong ORDER BY RANDOM()"""
"""
LIMITED TO ONE ARTIST...
"""
# db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, genre, file_path, duration FROM tracks\
# WHERE artist LIKE "%bad omens%" GROUP BY artistdashsong ORDER BY RANDOM()'
# WHERE artist LIKE "%wage war%" GROUP BY artistdashsong ORDER BY id DESC'
async with sqlite3.connect(self.active_playlist_path,
timeout=2) as db_conn:

View File

@ -34,7 +34,7 @@ class Transcriptions(FastAPI):
db_query: Optional[str] = None
show_title: Optional[str] = None
if not show_id:
if not isinstance(show_id, int):
return JSONResponse(status_code=500, content={
'err': True,
'errorText': 'Invalid request',