remove file path from notifications

This commit is contained in:
codey 2025-01-20 05:50:14 -05:00
parent e743a5186a
commit fd31e8c16d

View File

@ -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)}")