Skip to content

Download synced songs' covers - #410

Merged
hatstand merged 1 commit into
masterfrom
claude/project-thread-7edbi5
Nov 11, 2026
Merged

hatstand merged 1 commit into
masterfrom
claude/project-thread-7edbi5

Conversation

@hatstand

Copy link
Copy Markdown
Contributor

Requested by John · project thread

Part of media sync, behind testing features. Covers only arrive from a Clementine that sends SyncItem.art, which the Clementine change in this set adds; the iOS client gets the same change.

Summary

Kept songs played without a cover unless their file had one inside, for every kind of rule: the engine wrote artKey = null and never fetched SyncItem.art, although the store already had an art table for it.

  • SyncEngine takes a covers folder (filesDir/covers, not MediaStore, since covers aren't music) and downloads each cover once, however many songs share it, records it with putArt, and stores the song's artKey.
  • A song kept before this, or whose cover changed, gets the cover on the next sync without the song being downloaded again.
  • A cover that can't be downloaded doesn't fail the song: its artKey stays null and it's tried again next sync.
  • removeUnwanted deletes covers no song uses any more.
  • Cover keys must be hex, so a key can't name a path outside the covers folder.
  • KeptSong.art points at the cover. PhonePlayer shows it, or else the cover in the song's file as before, and sets it as the media item's artwork URI for the notification and lock screen.

Testing

New SyncEngineTest and KeptSongTest cases: one download per shared cover, covers for already-kept songs, retry after a failed cover, deleting unused covers, rejecting non-hash keys. CI runs them (no Android SDK here).


Generated by Claude Code

@hatstand hatstand self-assigned this Nov 11, 2026
Clementine sends a cover with each synced song that has one, but the
phone never fetched it, so kept songs played with no cover unless their
file had one inside. Sync now downloads each cover once, however many
songs share it, into the app's own covers folder (not MediaStore, as
covers aren't music), records it in the store's art table, and deletes
covers no song uses any more. A song kept before this gets its cover on
the next sync without being downloaded again, and a cover that fails to
download is tried again next time without failing the song.

The phone player, its notification and the lock screen show
Clementine's cover, or else the one in the song's file, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R2bAq6hMmUmb79VSMAxLPp
@hatstand
hatstand force-pushed the claude/project-thread-7edbi5 branch from b8e162d to fae52c2 Compare November 11, 2026 17:32
@hatstand
hatstand merged commit 8ff58b4 into master Nov 11, 2026
7 checks passed
@hatstand
hatstand deleted the claude/project-thread-7edbi5 branch November 11, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants