clean TODO comment//already done
This commit is contained in:
parent
4506714d0a
commit
96add377df
@ -15,11 +15,6 @@ from fastapi import (FastAPI, BackgroundTasks, Request,
|
|||||||
Response, HTTPException)
|
Response, HTTPException)
|
||||||
from fastapi.responses import RedirectResponse, JSONResponse
|
from fastapi.responses import RedirectResponse, JSONResponse
|
||||||
|
|
||||||
"""
|
|
||||||
TODO:
|
|
||||||
- Radio request typeahead
|
|
||||||
"""
|
|
||||||
|
|
||||||
class Radio(FastAPI):
|
class Radio(FastAPI):
|
||||||
"""Radio Endpoints"""
|
"""Radio Endpoints"""
|
||||||
def __init__(self, app: FastAPI,
|
def __init__(self, app: FastAPI,
|
||||||
|
@ -148,8 +148,6 @@ class RadioUtil:
|
|||||||
|
|
||||||
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\
|
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%"\
|
WHERE (genre LIKE "%metalcore%"\
|
||||||
OR genre LIKE "%rock%"\
|
|
||||||
OR genre LIKE "%pop punk%"\
|
|
||||||
OR genre LIKE "%math rock%"\
|
OR genre LIKE "%math rock%"\
|
||||||
OR genre LIKE "%punk rock%"\
|
OR genre LIKE "%punk rock%"\
|
||||||
OR genre LIKE "%metal%"\
|
OR genre LIKE "%metal%"\
|
||||||
@ -171,13 +169,10 @@ class RadioUtil:
|
|||||||
OR genre LIKE "%hardcore%"\
|
OR genre LIKE "%hardcore%"\
|
||||||
OR genre LIKE "%hair metal%"\
|
OR genre LIKE "%hair metal%"\
|
||||||
OR genre LIKE "%horror punk%"\
|
OR genre LIKE "%horror punk%"\
|
||||||
OR genre LIKE "%folk punk%"\
|
|
||||||
OR genre LIKE "%breakcore%"\
|
OR genre LIKE "%breakcore%"\
|
||||||
OR genre LIKE "%post-rock%"\
|
OR genre LIKE "%post-rock%"\
|
||||||
OR genre LIKE "%deathcore%"\
|
OR genre LIKE "%deathcore%"\
|
||||||
OR genre LIKE "%hardcore punk%"\
|
OR genre LIKE "%hardcore punk%"\
|
||||||
OR genre LIKE "%synthwave%"\
|
|
||||||
OR genre LIKE "%trap%"\
|
|
||||||
OR genre LIKE "%indie pop%"\
|
OR genre LIKE "%indie pop%"\
|
||||||
OR genre LIKE "%dnb%")\
|
OR genre LIKE "%dnb%")\
|
||||||
GROUP BY artistdashsong ORDER BY RANDOM()"""
|
GROUP BY artistdashsong ORDER BY RANDOM()"""
|
||||||
@ -186,15 +181,15 @@ class RadioUtil:
|
|||||||
LIMITED TO ONE/SMALL SUBSET OF GENRES
|
LIMITED TO ONE/SMALL SUBSET OF GENRES
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\
|
db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\
|
||||||
# WHERE (artist LIKE "%bad omens%") AND (NOT song LIKE "%(live%") ORDER BY artist DESC, album ASC, song ASC'
|
WHERE (artist LIKE "%winds of plague%" OR artist LIKE "%acacia st%" OR artist LIKE "%suicide si%" OR artist LIKE "%in dying%") AND (NOT song LIKE "%(live%") ORDER BY RANDOM()' #ORDER BY artist DESC, album ASC, song ASC'
|
||||||
|
|
||||||
"""
|
"""
|
||||||
LIMITED TO ONE/SOME ARTISTS...
|
LIMITED TO ONE/SOME ARTISTS...
|
||||||
"""
|
"""
|
||||||
|
|
||||||
db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\
|
# db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\
|
||||||
WHERE (artist LIKE "%we butter%" OR artist LIKE "%eisbrecher%" OR artist LIKE "%black ang%" OR artist LIKE "%madison affair%") AND (NOT song LIKE "%%stripped%%" AND NOT song LIKE "%(2022)%" AND NOT song LIKE "%(live%%" AND NOT song LIKE "%%acoustic%%" AND NOT song LIKE "%%instrumental%%" AND NOT song LIKE "%%remix%%" AND NOT song LIKE "%%reimagined%%" AND NOT song LIKE "%%alternative%%" AND NOT song LIKE "%%unzipped%%") GROUP BY artistdashsong ORDER BY RANDOM()'# ORDER BY album ASC, id ASC'
|
# WHERE (artist LIKE "%we butter%" OR artist LIKE "%eisbrecher%" OR artist LIKE "%black ang%" OR artist LIKE "%madison affair%") AND (NOT song LIKE "%%stripped%%" AND NOT song LIKE "%(2022)%" AND NOT song LIKE "%(live%%" AND NOT song LIKE "%%acoustic%%" AND NOT song LIKE "%%instrumental%%" AND NOT song LIKE "%%remix%%" AND NOT song LIKE "%%reimagined%%" AND NOT song LIKE "%%alternative%%" AND NOT song LIKE "%%unzipped%%") GROUP BY artistdashsong ORDER BY RANDOM()'# ORDER BY album ASC, id ASC'
|
||||||
|
|
||||||
async with sqlite3.connect(self.active_playlist_path,
|
async with sqlite3.connect(self.active_playlist_path,
|
||||||
timeout=2) as db_conn:
|
timeout=2) as db_conn:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user