Implement better artwork cache keys

This commit is contained in:
Deluan
2023-01-17 20:37:10 -05:00
parent 93adda66d9
commit bedd2b2074
5 changed files with 39 additions and 11 deletions
+5 -6
View File
@@ -62,13 +62,12 @@ func newArtistReader(ctx context.Context, artwork *artwork, artID model.ArtworkI
}
func (a *artistReader) Key() string {
agentsHash := md5.Sum([]byte(conf.Server.Agents + conf.Server.Spotify.ID))
hash := md5.Sum([]byte(conf.Server.Agents + conf.Server.Spotify.ID))
return fmt.Sprintf(
"%s.%d.%d.%x",
a.artID,
a.lastUpdate.UnixMilli(),
a.size,
agentsHash,
"%s.%x.%t",
a.cacheKey.Key(),
hash,
conf.Server.EnableExternalServices,
)
}