Repository navigation
Conversation
This was referenced Oct 28, 2026
ScreenshotsFrom run 40992277753, against a real Clementine. Left: main. Right: this pull request, light and dark.
Screens at a failure |
Contributor
Author
|
Generated by Claude Code |
The phone's record of what it keeps for offline listening: the sync rules, the songs and covers it has downloaded, which rules want which songs, and plays made on the phone, all kept per Clementine by its server id. A song is stored once however many rules want it, and goes once no rule wants it and it isn't pinned. It has the same tables as the Android client's, and nothing uses it yet. The database wrapper learns NULLs, blobs and typed rows for it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01R2bAq6kZW6eyymkA3zsd4p
SyncEngine brings the phone's songs in line with the rules for one Clementine: it asks for each rule's manifest, downloads the songs that are new or changed into the synced songs' folder as Artist/Album/NN Title, and deletes the songs no rule or pin wants any more. A song in several rules is downloaded once, a rule that fails keeps its songs and lets the others carry on, and a sync cut short keeps what it downloaded. It talks to Clementine through SyncConnection, so the tests run it against a fake one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01R2bAq6kZW6eyymkA3zsd4p
RemoteSession.syncing says whether this Clementine can sync: it has SERVER_FEATURE_SYNC and a server id, the build has the testing features, and Clementine lets the phone download songs. When one connects, the Syncer runs the sync engine against it: ClementineSyncConnection asks for manifests over the session's connection, waiting at most a minute for each source's answer, and fetches songs from Clementine's HTTP server, as the renderer does. Songs go to Documents/Clementine/Synced, which the Downloads tab leaves out of the songs on the phone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01R2bAq6kZW6eyymkA3zsd4p
hatstand
force-pushed
the
claude/project-thread-wugi27-sync-connection
branch
from
October 30, 2026 02:32
f604129 to
e03e403
Compare
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.





































Builds on #61 (the sync engine), and through it #57 (the store). Until they merge, review only the commit "Sync songs to the phone while connected to Clementine" (089994f). #58 has merged.
It's part of media sync, which keeps music from Clementine on the phone to play offline. The design doc describes the whole of it.
This connects the sync engine to the Clementine the app is connected to, as Android-Remote#362 does on Android:
RemoteSession.syncingsays whether this Clementine can sync: it advertisesSERVER_FEATURE_SYNCand sends aserver_id, and the build hasTestingFeatures.enabled.downloadsAllowedfollows Clementine's allow downloads setting. Without all of them, nothing about sync shows.ClementineSyncConnectionasks for a manifest over the session's connection and waits for the answer for the same source (a minute at most), throughSyncManifests. It fetches songs from Clementine's HTTP server on the address and port the phone connected to, resolving paths as the renderer does.Syncerruns the engine each time a Clementine that can sync connects, and when asked (syncNow), once more if asked while running. Itsstatussays whether it's running and each rule's outcome, for the Sync screen.Documents/Clementine/Synced, beside downloaded songs, so the Files app shows them. The Downloads tab leaves that folder out of the songs on the phone. The store is opened in Application Support, and only in builds with the testing features.There's nothing to sync yet: making rules comes with the next pull request. Tests cover the sync state from Clementine's info, waiting for the right manifest, giving up when Clementine doesn't answer, fetching over HTTP from a local server, and a whole sync when Clementine connects.
Songs are fetched over plain HTTP, which App Transport Security allows on the local network (
NSAllowsLocalNetworking). Syncing with a Clementine reached over the internet would need an exception as well, which can come later.Generated by Claude Code