This commit is contained in:
codey 2025-02-16 20:57:13 -05:00
parent f68abca2b1
commit 405718870c

View File

@ -63,7 +63,8 @@ class RadioUtil:
Returns: Returns:
str str
""" """
return str(datetime.timedelta(seconds=s)).split(".", maxsplit=1)[0] return str(datetime.timedelta(seconds=s))\
.split(".", maxsplit=1)[0]
async def trackdb_typeahead(self, query: str) -> Optional[list[str]]: async def trackdb_typeahead(self, query: str) -> Optional[list[str]]:
if not query: if not query:
@ -71,7 +72,7 @@ class RadioUtil:
async with sqlite3.connect(self.active_playlist_path, async with sqlite3.connect(self.active_playlist_path,
timeout=1) as _db: timeout=1) as _db:
_db.row_factory = sqlite3.Row _db.row_factory = sqlite3.Row
db_query: str = 'SELECT DISTINCT(artist || " - " || song) as artistsong FROM tracks WHERE\ db_query: str = 'SELECT DISTINCT(LOWER(TRIM(artist) || " - " || TRIM(song))) as artistsong FROM tracks WHERE\
artistsong LIKE ? LIMIT 30' artistsong LIKE ? LIMIT 30'
db_params: tuple[str] = (f"%{query}%",) db_params: tuple[str] = (f"%{query}%",)
async with _db.execute(db_query, db_params) as _cursor: async with _db.execute(db_query, db_params) as _cursor: