diff --git a/lyric_search_new/sources/redis_cache.py b/lyric_search_new/sources/redis_cache.py index b7d7461..29c2ced 100644 --- a/lyric_search_new/sources/redis_cache.py +++ b/lyric_search_new/sources/redis_cache.py @@ -59,7 +59,7 @@ class RedisCache: if str(result) != "OK": raise RedisException(f"Redis: Failed to create index: {result}") except Exception as e: - await self.notifier.send(f"ERROR @ {__file__}", f"Failed to create idx: {str(e)}") + await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}", f"Failed to create idx: {str(e)}") def sanitize_input(self, artist: str, song: str) -> tuple[str, str]: """ @@ -120,7 +120,7 @@ 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__}", f"{str(e)}\nSearch was: {artist} - {song}") + await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}", f"{str(e)}\nSearch was: {artist} - {song}") traceback.print_exc() async def redis_store(self, sqlite_id: int, lyr_result: LyricsResult) -> None: @@ -155,6 +155,6 @@ class RedisCache: await self.notifier.send("INFO", f"Stored {lyr_result.artist} - {lyr_result.song} (related SQLite Row ID: {sqlite_id}) to {newkey}") except Exception as e: - await self.notifier.send(f"ERROR @ {__file__}", + await self.notifier.send(f"ERROR @ {__file__.rsplit("/", maxsplit=1)[-1]}", f"Failed to store {lyr_result.artist} - {lyr_result.song}\ (SQLite id: {sqlite_id}) to Redis:\n{str(e)}") \ No newline at end of file