Repository navigation
Import Apple Music playlists as tracklists - #129
Merged
Merged
Conversation
Adds a fourth library toolbar action: read the user's Apple Music
playlists and import the ones they pick. Apple Music audio is DRM-locked
the same way Spotify's is, so this imports metadata only — each track
carries a searchQuery and the existing pipeline re-sources the recording
from YouTube.
MediaPlayer rather than MusicKit on purpose: MPMediaQuery gives us title
+ artist with only NSAppleMusicUsageDescription, while MusicKit would
need the App Service enabled on the App ID — a provisioning change that
breaks cloud-signed TestFlight builds. The reader sits behind
AppleMusicLibraryReading so a MusicKit implementation can replace it.
- ContinuityCore: AppleMusicTrack/AppleMusicPlaylistContents plus title
normalization that strips release-edition noise ("Remastered 2009",
"- Deluxe Edition") which YouTube titles don't repeat, while keeping
the qualifiers that name a different recording (feat./Live/Remix).
- MetadataSourcedTrack unifies the Spotify and Apple Music shapes, so
applySpotifySync generalizes to applyMetadataSync and both paths share
one sync implementation.
- Playlists are source-backed by MPMediaPlaylist persistentID, so sync
re-reads the local library and works offline; a playlist deleted in
Music leaves the local import untouched rather than wiping it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jaasthisenna-jpg
approved these changes
Jul 21, 2026
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.
Adds a fourth library toolbar action: read the user's Apple Music playlists and import the ones they pick.
Apple Music audio is DRM-locked the same way Spotify's is, so this imports metadata only — each track carries a
searchQueryand the existing pipeline re-sources the recording from YouTube. Same trade the Spotify importer already makes.Why MediaPlayer and not MusicKit
MPMediaQuerygives us title + artist with onlyNSAppleMusicUsageDescription. MusicKit would additionally need the MusicKit App Service enabled on the App ID — a provisioning-profile change, and the TestFlight pipeline signs in the cloud, where a capability mismatch fails with "No profiles for 'com.sanylax.continuity'". The reader sits behindAppleMusicLibraryReading, so a MusicKit implementation can drop in later without touching callers.What's here
AppleMusicTrack/AppleMusicPlaylistContents, plus title normalization that strips release-edition noise (Remastered 2009,- Deluxe Edition,[Explicit]) that YouTube titles don't repeat, while keeping qualifiers that name a genuinely different recording (feat.,Live,Acoustic, remix credits). 17 new Linux-testable cases.applySpotifySyncgeneralizes intoapplyMetadataSync; both paths now share one sync implementation instead of a copy.PlaylistSource.appleMusic.AppleMusicLibraryReader(queries run off the main actor;MPMedia*objects never escape the closure) andPreparationQueue.importAppleMusicPlaylist.AppleMusicImportView: permission prompt, multi-select playlist list, Settings deep-link when access is denied.Playlists are source-backed by
MPMediaPlaylist.persistentID, so sync re-reads the local library and works offline. A playlist deleted in Music leaves the local import untouched rather than wiping it, and re-importing updates in place instead of duplicating.Verification
swift testin ContinuityCore: 211/211 pass (17 new).🤖 Generated with Claude Code