Use more conventional Redis key separators for album cache

This commit is contained in:
Danielle McLean 2024-05-14 15:09:20 +10:00
parent a471b77c55
commit 4a2ac29d30
Signed by: 00dani
GPG key ID: 6854781A0488421C

View file

@ -16,7 +16,7 @@ class ArtCacheEntry(TypedDict):
def calc_album_key(song: CurrentSongResponse) -> str:
artist = song.get("albumartist", song.get("artist", "Unknown Artist"))
album = song.get("album", "Unknown Album")
return f"{artist}:-:-:{album}"
return ":".join(t.replace(":", "-") for t in (artist, album))
def calc_track_key(song: CurrentSongResponse) -> str: