bugfix randmsg/minor

This commit is contained in:
codey 2025-02-16 14:04:59 -05:00
parent 3567e750fa
commit e3b66624ab
3 changed files with 3 additions and 3 deletions

View File

@ -100,7 +100,7 @@ class RandMsgRequest(BaseModel):
- **short**: Short randmsg? - **short**: Short randmsg?
""" """
short: Optional[bool] short: Optional[bool] = False
""" """
YT YT

View File

@ -304,7 +304,7 @@ class Radio(FastAPI):
'err': True, 'err': True,
'errorText': 'Invalid request.', 'errorText': 'Invalid request.',
}) })
typeahead = await self.radio_util.trackdb_typeahead(data.query) typeahead: Optional[list[str]] = await self.radio_util.trackdb_typeahead(data.query)
if not typeahead: if not typeahead:
return JSONResponse(content=[]) return JSONResponse(content=[])
return JSONResponse(content=typeahead) return JSONResponse(content=typeahead)

View File

@ -72,7 +72,7 @@ class RadioUtil:
timeout=1) as _db: timeout=1) as _db:
_db.row_factory = sqlite3.Row _db.row_factory = sqlite3.Row
db_query: str = 'SELECT (artist || " - " || song) as artistsong FROM tracks WHERE\ db_query: str = 'SELECT (artist || " - " || song) as artistsong FROM tracks WHERE\
artistsong LIKE ? LIMIT 15' 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:
result: Iterable[sqlite3.Row] = await _cursor.fetchall() result: Iterable[sqlite3.Row] = await _cursor.fetchall()