Repository navigation
Name cached artwork by its bytes so art that arrives before its metadata still refreshes - #21
Merged
chrisuthe merged 2 commits intoSep 2, 2026
Conversation
…ata still refreshes With a queue the server can deliver the next track's picture before the next track's metadata. Named from the current metadata, that picture overwrote the current track's file in place, and every consumer dedupes by path: the window's reload check and the Plasma and GNOME applets' URL cache. So nothing refreshed until a later track whose art followed its metadata. Hash the image bytes instead. A new picture is always a new path; the same picture re-sent is the same path, which is the dedupe working as intended.
…ationale in one place Retention had nothing behind it; content naming adds a new interaction (a re-sent picture moves to newest rather than taking a ninth slot), so pin both. The why lives in ArtworkFileName's remarks now and the other sites point there. Note the loose thread the fix exposed: the handler ignores the frame's channel and display timestamp.
chrisuthe
marked this pull request as ready for review
September 2, 2026 11:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
With a queue in place, Music Assistant can deliver the next track's picture before the next track's metadata. The cache named the file from the metadata the group held when the bytes arrived, so that picture overwrote the current track's file in place under an unchanged path. Every consumer dedupes by path: the window reloads only when the path changes, and the Plasma and GNOME applets cache cover art by URL. So the art stayed stale until a later track whose picture happened to follow its metadata. Not a platform difference: the Windows and macOS heads joined fresh with no queue and never saw the order.
What
MediaSessionMapper.ArtworkFileNamehashes the image bytes (SHA-256, first 16 bytes, hex) instead of the track identity. A new picture is always a new path; the same picture re-sent is the same path, which is the dedupe working as intended.ArtworkCache.Writedrops its track-identity parameter; retention (keep the newest eight) is unchanged and now has tests.SendspinPlayerService.OnArtworkReceivedno longer reads the group's metadata.MainViewModel.LoadArtworkkeeps its path check, with the comment saying why the path is trustworthy.ArtworkCacheTestspins retention.Observed live
On this box against MA Production, running this branch's Release build under the usual settings, with a Tame Impala artist queue (different covers per track):
mpris:artUrlmoved to a new content-hashed path on each skip: Lonerism, then Sundown Syndrome / Remember Me, then Live Versions.artUrlpointed atartwork-notrack.jpgwhile "The Moment" was loaded.Two caveats against the acceptance criterion as written. The player was not grouped with another player; the trigger is the queue's ordering, not grouping, and the ordering was reproduced (two pictures were written for the first track, the second before its metadata). The Plasma applet was not screenshotted, since opening it needs a click; it keys its cache on the MPRIS URL, which is now new per picture.
Checks
make test: 348 + 172 passingdotnet format --verify-no-changeson Core, Platform.Shared, Player, Tests: clean