diff --git a/conf/configuration.go b/conf/configuration.go index d477e55e3..de29216cc 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -423,7 +423,7 @@ func Load(noConfigDump bool) { logDeprecatedOptions("CoverJpegQuality", "CoverArtQuality") // Removed options - logRemovedOptions("Spotify.ID", "Spotify.Secret", "DevJpegCoverArt") + logRemovedOptions("Spotify.ID", "Spotify.Secret") // Call init hooks for _, hook := range hooks { diff --git a/core/artwork/cache_warmer.go b/core/artwork/cache_warmer.go index 487c91abf..3dddd2c6f 100644 --- a/core/artwork/cache_warmer.go +++ b/core/artwork/cache_warmer.go @@ -22,8 +22,8 @@ type CacheWarmer interface { } // NewCacheWarmer creates a new CacheWarmer instance. The CacheWarmer will pre-cache Artwork images in the background -// to speed up the response time when the image is requested by the UI. The cache is pre-populated with the size -// defined by the UICoverArtSize config option (the original-size image is also cached as a side effect of resizing). +// to speed up the response time when the image is requested by the UI. The cache is pre-populated with the original +// image size, as well as the size defined by the UICoverArtSize config option. func NewCacheWarmer(artwork Artwork, cache cache.FileCache) CacheWarmer { // If image cache is disabled, return a NOOP implementation if conf.Server.ImageCacheSize == "0" || !conf.Server.EnableArtworkPrecache { @@ -37,11 +37,10 @@ func NewCacheWarmer(artwork Artwork, cache cache.FileCache) CacheWarmer { } a := &cacheWarmer{ - artwork: artwork, - cache: cache, - buffer: make(map[model.ArtworkID]struct{}), - wakeSignal: make(chan struct{}, 1), - coverArtSize: conf.Server.UICoverArtSize, + artwork: artwork, + cache: cache, + buffer: make(map[model.ArtworkID]struct{}), + wakeSignal: make(chan struct{}, 1), } // Create a context with a fake admin user, to be able to pre-cache Playlist CoverArts @@ -51,12 +50,11 @@ func NewCacheWarmer(artwork Artwork, cache cache.FileCache) CacheWarmer { } type cacheWarmer struct { - artwork Artwork - buffer map[model.ArtworkID]struct{} - mutex sync.Mutex - cache cache.FileCache - wakeSignal chan struct{} - coverArtSize int + artwork Artwork + buffer map[model.ArtworkID]struct{} + mutex sync.Mutex + cache cache.FileCache + wakeSignal chan struct{} } func (a *cacheWarmer) PreCache(artID model.ArtworkID) { @@ -143,7 +141,7 @@ func (a *cacheWarmer) doCacheImage(ctx context.Context, id model.ArtworkID) erro ctx, cancel := context.WithTimeout(ctx, 10*time.Second) defer cancel() - size := a.coverArtSize + size := conf.Server.UICoverArtSize r, _, err := a.artwork.Get(ctx, id, size, true) if err != nil { return fmt.Errorf("caching id='%s', size=%d: %w", id, size, err) diff --git a/core/artwork/reader_resized.go b/core/artwork/reader_resized.go index 955b08548..85a19a4c3 100644 --- a/core/artwork/reader_resized.go +++ b/core/artwork/reader_resized.go @@ -65,9 +65,6 @@ func (a *resizedArtworkReader) Key() string { if a.square { return baseKey + ".square" } - if conf.Server.EnableWebPEncoding { - return fmt.Sprintf("%s.%d.webp", baseKey, conf.Server.CoverArtQuality) - } return fmt.Sprintf("%s.%d", baseKey, conf.Server.CoverArtQuality) } @@ -113,7 +110,7 @@ func (a *resizedArtworkReader) resizeImage(ctx context.Context, reader io.Reader // Preserve animation for animated images if isAnimatedGIF(data) { - if conf.Server.EnableWebPEncoding && a.a.ffmpeg.IsAvailable() { + if a.a.ffmpeg.IsAvailable() { // Animated GIF: convert to animated WebP via ffmpeg (with optional resize) r, err := a.a.ffmpeg.ConvertAnimatedImage(ctx, bytes.NewReader(data), a.size, conf.Server.CoverArtQuality) if err == nil {