progress -- change get to search for lrclib

This commit is contained in:
2025-01-14 10:04:05 -05:00
parent 9d8d38081a
commit f86d5a4fec
6 changed files with 113 additions and 8 deletions

View File

@@ -48,7 +48,8 @@ class Cache:
for ext in self.sqlite_exts:
await db_conn.load_extension(ext)
async with await db_conn.executescript(self.cache_pre_query) as _db_cursor:
search_query = 'SELECT id, artist, song, lyrics, src, confidence FROM lyrics WHERE editdist3((artist || " " || song), (? || " " || ?))\
search_query = 'SELECT id, artist, song, lyrics, src, confidence FROM lyrics\
WHERE editdist3((artist || " " || song), (? || " " || ?))\
<= 410 ORDER BY editdist3((artist || " " || song), ?) ASC LIMIT 10'
search_params = (artist.strip(), song.strip(),
f"{artist.strip()} {song.strip()}")