Skip to content

Download synced songs' covers - #86

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

hatstand merged 1 commit into
mainfrom
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 Android 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: nil and never fetched SyncItem.art, although the store already had an art table for it.

  • SyncEngine downloads each cover once, however many songs share it, into a hidden .covers/<key> beside the songs (so it stays out of the Files app's view of the music), 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 nil 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 .covers.
  • KeptSong.artFile points at the cover; PhonePlayer shows it, or else the cover in the song's file as before, so the player and lock screen both get it.

Testing

New SyncEngineTests: one download per shared cover, covers for already-kept songs, retry after a failed cover, deleting unused covers, rejecting non-hash keys. CI builds and runs them (no Swift toolchain 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 a hidden .covers folder beside the songs, 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 shows 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
@github-actions

Copy link
Copy Markdown

Screenshots

From run 43068724329, against a real Clementine. Left: main. Right: this pull request, light and dark.

Screen main This PR This PR, dark
01_connect
02_queue
03_player
04_connection
05_settings
06_library
07_library_album
08_search
09_outputs
10_internet
11_internet_radio
fold_outer_player –

Screens at a failure

dark_failure

failure

@hatstand
hatstand merged commit 2006d29 into main Nov 11, 2026
5 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