quintodrome/core/artwork
Deluan Quintão 2f5b2b5135
fix(artwork): fallback mediafile cover art to disc artwork before album (#5216)
* fix(artwork): fallback mediafile cover art to disc artwork before album

Changed the mediafile cover art fallback chain to go through disc artwork
before album artwork (mediafile → disc → album). Previously, mediafiles
without embedded art fell back directly to album cover, bypassing any
disc-specific artwork. Renamed AlbumCoverArtID() to DiscCoverArtID() to
encapsulate the disc-vs-album decision in a single method, used by both
CoverArtID() and the mediafile artwork reader.

Signed-off-by: Deluan <deluan@navidrome.org>

* fix(artwork): fix cache invalidation for mediafile and album cover art

Include imagesUpdatedAt from album folders in the mediafile artwork
reader's cache key, so that when a cover image file changes on disk
(without audio metadata changes) the mediafile cache properly
invalidates. Also include CoverArtPriority unconditionally in the album
artwork reader's cache key hash, so that changing the priority order
with external services disabled correctly invalidates the album cache.

* fix(artwork): skip disc artwork resolution for single-disc albums

Single-disc albums with DiscNumber=1 were unnecessarily routed through
discArtworkReader, which does extra DB queries only to fall through to
album art anyway. Now only multi-disc albums use the disc fallback path.

* refactor(artwork): restore AlbumCoverArtID as a separate method

Extract AlbumCoverArtID back out of DiscCoverArtID so the single-disc
fallback path in reader_mediafile can reference it by name instead of
inlining the artwork ID construction.

---------

Signed-off-by: Deluan <deluan@navidrome.org>
2026-03-16 18:08:39 -04:00
..
animation.go feat(artwork): preserve animated image artwork during resize (#5184) 2026-03-13 18:11:12 -04:00
animation_test.go feat(artwork): preserve animated image artwork during resize (#5184) 2026-03-13 18:11:12 -04:00
artwork.go feat(artwork): add per-disc cover art support (#5182) 2026-03-13 18:33:18 -04:00
artwork_internal_test.go fix(artwork): fallback mediafile cover art to disc artwork before album (#5216) 2026-03-16 18:08:39 -04:00
artwork_suite_test.go Fix tests and clean up code a bit 2022-12-28 15:31:56 -05:00
artwork_test.go Fix image stuttering (#3035) 2024-05-24 20:19:26 -04:00
benchmark_decode_test.go perf(artwork): improve image serving performance with WebP encoding and optimized pipeline (#5181) 2026-03-13 09:35:59 -04:00
benchmark_e2e_test.go perf(artwork): improve image serving performance with WebP encoding and optimized pipeline (#5181) 2026-03-13 09:35:59 -04:00
benchmark_encode_test.go perf(artwork): improve image serving performance with WebP encoding and optimized pipeline (#5181) 2026-03-13 09:35:59 -04:00
benchmark_helpers_test.go perf(artwork): improve image serving performance with WebP encoding and optimized pipeline (#5181) 2026-03-13 09:35:59 -04:00
benchmark_pipeline_test.go feat(artwork): preserve animated image artwork during resize (#5184) 2026-03-13 18:11:12 -04:00
benchmark_tag_test.go perf(artwork): improve image serving performance with WebP encoding and optimized pipeline (#5181) 2026-03-13 09:35:59 -04:00
cache_warmer.go perf(artwork): improve image serving performance with WebP encoding and optimized pipeline (#5181) 2026-03-13 09:35:59 -04:00
cache_warmer_test.go refactor: run Go modernize (#5002) 2026-02-08 09:57:30 -05:00
image_cache.go Add lastUpdated to coverArt ids. Helps with invalidating art cache client-side. 2023-02-08 20:03:31 -05:00
reader_album.go fix(artwork): fallback mediafile cover art to disc artwork before album (#5216) 2026-03-16 18:08:39 -04:00
reader_album_test.go fix(artwork): search parent folders for album cover art in multi-disc layouts (#5157) 2026-03-09 10:52:13 -04:00
reader_artist.go feat: add artist image uploads and image-folder artwork source (#5198) 2026-03-15 22:19:55 -04:00
reader_artist_test.go feat: add artist image uploads and image-folder artwork source (#5198) 2026-03-15 22:19:55 -04:00
reader_disc.go feat(artwork): add per-disc cover art support (#5182) 2026-03-13 18:33:18 -04:00
reader_disc_test.go feat(artwork): add per-disc cover art support (#5182) 2026-03-13 18:33:18 -04:00
reader_mediafile.go fix(artwork): fallback mediafile cover art to disc artwork before album (#5216) 2026-03-16 18:08:39 -04:00
reader_playlist.go perf(artwork): improve image serving performance with WebP encoding and optimized pipeline (#5181) 2026-03-13 09:35:59 -04:00
reader_resized.go feat(artwork): preserve animated image artwork during resize (#5184) 2026-03-13 18:11:12 -04:00
reader_resized_test.go feat(artwork): preserve animated image artwork during resize (#5184) 2026-03-13 18:11:12 -04:00
sources.go refactor(server): remove legacy embedded coverart logic 2026-03-05 19:53:59 -05:00
wire_providers.go Handle "naked" CoverArtIDs (IDs of album, mediafiles and playlists) 2022-12-28 15:31:56 -05:00