base: add allowed CORS origins for localhost:4321 (dev purposes); lyric_search: change typeahead to return a maximum of 10 results, prev. 100

This commit is contained in:
2025-06-22 07:54:32 -04:00
parent a6128c7647
commit 0fe081597e
3 changed files with 14 additions and 13 deletions

View File

@ -31,7 +31,7 @@ class CacheUtils:
_db.row_factory = sqlite3.Row
db_query: str = """SELECT DISTINCT(LOWER(TRIM(artist) || " - " || TRIM(song))),\
(TRIM(artist) || " - " || TRIM(song)) as ret FROM lyrics WHERE\
ret LIKE ? LIMIT 100"""
ret LIKE ? LIMIT 10"""
db_params: tuple[str] = (f"%%%{query}%%%",)
async with _db.execute(db_query, db_params) as _cursor:
result: Iterable[sqlite3.Row] = await _cursor.fetchall()
@ -175,7 +175,7 @@ class LyricSearch(FastAPI):
return JSONResponse(
content={
"err": True,
"errorText": "Sources exhausted, lyrics not located.",
"errorText": "Failed to locate lyrics on any available sources.",
}
)