p3 & dedupe typeahead results
This commit is contained in:
parent
035a52d9b2
commit
f68abca2b1
@ -71,7 +71,7 @@ class RadioUtil:
|
||||
async with sqlite3.connect(self.active_playlist_path,
|
||||
timeout=1) as _db:
|
||||
_db.row_factory = sqlite3.Row
|
||||
db_query: str = 'SELECT (artist || " - " || song) as artistsong FROM tracks WHERE\
|
||||
db_query: str = 'SELECT DISTINCT(artist || " - " || song) as artistsong FROM tracks WHERE\
|
||||
artistsong LIKE ? LIMIT 30'
|
||||
db_params: tuple[str] = (f"%{query}%",)
|
||||
async with _db.execute(db_query, db_params) as _cursor:
|
||||
|
@ -30,7 +30,8 @@ class RandMsg(FastAPI):
|
||||
short: Optional[bool] = False
|
||||
if isinstance(data, RandMsgRequest):
|
||||
short = data.short
|
||||
db_rand_selected: int = 9
|
||||
if short:
|
||||
db_rand_selected: int = 9
|
||||
db_rand_selected = random.choice([0, 1, 3])
|
||||
title_attr: str = "Unknown"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user