This commit is contained in:
codey 2025-01-14 11:13:39 -05:00
parent f3336b09ac
commit 861f4766b3
4 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,7 @@ class Aggregate:
async def search(self, artist: str, song: str) -> Optional[LyricsResult]: async def search(self, artist: str, song: str) -> Optional[LyricsResult]:
"""Aggregate Search""" """Aggregate Search"""
logging.info("Performing aggregate search")
cache_search = cache.Cache() cache_search = cache.Cache()
genius_search = genius.Genius() genius_search = genius.Genius()
lrclib_search = lrclib.LRCLib() lrclib_search = lrclib.LRCLib()

View File

@ -50,6 +50,8 @@ class Cache:
artist = artist.strip().lower() artist = artist.strip().lower()
song = song.strip().lower() song = song.strip().lower()
try: try:
logging.info("Searching %s - %s on %s",
artist, song, self.label)
async with sqlite3.connect(self.cache_db, timeout=2) as db_conn: async with sqlite3.connect(self.cache_db, timeout=2) as db_conn:
await db_conn.enable_load_extension(True) await db_conn.enable_load_extension(True)
for ext in self.sqlite_exts: for ext in self.sqlite_exts:

View File

@ -38,6 +38,8 @@ class Genius:
@song: the song to search @song: the song to search
""" """
try: try:
logging.info("Searching %s - %s on %s",
artist, song, self.label)
artist = artist.strip().lower() artist = artist.strip().lower()
song = song.strip().lower() song = song.strip().lower()
search_term = f'{artist}%20{song}' search_term = f'{artist}%20{song}'

View File

@ -34,6 +34,8 @@ class LRCLib:
@song: the song to search @song: the song to search
""" """
try: try:
logging.info("Searching %s - %s on %s",
artist, song, self.label)
artist = artist.strip().lower() artist = artist.strip().lower()
song = song.strip().lower() song = song.strip().lower()
returned_lyrics = '' returned_lyrics = ''