notify changes
This commit is contained in:
		| @@ -71,6 +71,8 @@ class Aggregate: | |||||||
|             if plain: #  do not record LRC fails |             if plain: #  do not record LRC fails | ||||||
|                 try:  |                 try:  | ||||||
|                     await self.redis_cache.increment_found_count("failed") |                     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: |                 except Exception as e: | ||||||
|                     traceback.print_exc() |                     traceback.print_exc() | ||||||
|                     logging.info("Could not increment redis failed counter: %s", |                     logging.info("Could not increment redis failed counter: %s", | ||||||
|   | |||||||
| @@ -149,8 +149,8 @@ class RedisCache: | |||||||
|                 if not search_res_out: |                 if not search_res_out: | ||||||
|                     logging.debug("Redis: Normal search failed, trying with fuzzy search") |                     logging.debug("Redis: Normal search failed, trying with fuzzy search") | ||||||
|                      |                      | ||||||
|                     (fuzzy_artist, fuzzy_song) = self.sanitize_input(artist=artist, |                     (fuzzy_artist, fuzzy_song) = self.sanitize_input(artist=artist.split(" ")[0:5], | ||||||
|                                                                      song=song, fuzzy=True) |                                                                      song=song.split(" ")[0:6], fuzzy=True) | ||||||
|                     search_res = await self.redis_client.ft().search(Query( |                     search_res = await self.redis_client.ft().search(Query( | ||||||
|                         f"@artist:{fuzzy_artist} @song:{fuzzy_song}" |                         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}*") |                 await self.notifier.send("WARNING", f"Redis cache miss for: \n## *{artist} - {song}*") | ||||||
|             return search_res_out |             return search_res_out | ||||||
|         except Exception as e: |         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() |             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: |     async def redis_store(self, sqlite_id: int, lyr_result: LyricsResult) -> None: | ||||||
|         """ |         """ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user