notify changes
This commit is contained in:
parent
7eba1da366
commit
2e179ca7e6
@ -71,6 +71,8 @@ class Aggregate:
|
||||
if plain: # do not record LRC fails
|
||||
try:
|
||||
await self.redis_cache.increment_found_count("failed")
|
||||
self.notifier.send("WARNING",
|
||||
f"Could not find {artist} - {song} via queried sources.")
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
logging.info("Could not increment redis failed counter: %s",
|
||||
|
@ -149,8 +149,8 @@ class RedisCache:
|
||||
if not search_res_out:
|
||||
logging.debug("Redis: Normal search failed, trying with fuzzy search")
|
||||
|
||||
(fuzzy_artist, fuzzy_song) = self.sanitize_input(artist=artist,
|
||||
song=song, fuzzy=True)
|
||||
(fuzzy_artist, fuzzy_song) = self.sanitize_input(artist=artist.split(" ")[0:5],
|
||||
song=song.split(" ")[0:6], fuzzy=True)
|
||||
search_res = await self.redis_client.ft().search(Query(
|
||||
f"@artist:{fuzzy_artist} @song:{fuzzy_song}"
|
||||
))
|
||||
@ -169,8 +169,11 @@ class RedisCache:
|
||||
await self.notifier.send("WARNING", f"Redis cache miss for: \n## *{artist} - {song}*")
|
||||
return search_res_out
|
||||
except Exception as e:
|
||||
await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}", f"{str(e)}\nSearch was: {artist} - {song}")
|
||||
traceback.print_exc()
|
||||
if fuzzy_artist and fuzzy_song:
|
||||
await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}", f"{str(e)}\nSearch was: {artist} - {song}; fuzzy: {fuzzy_artist} - {fuzzy_song}")
|
||||
else:
|
||||
await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}", f"{str(e)}\nSearch was: {artist} - {song}; fuzzy: {fuzzy_artist} - {fuzzy_song}")
|
||||
|
||||
async def redis_store(self, sqlite_id: int, lyr_result: LyricsResult) -> None:
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user