Fix: resolve real provider account from provider_mappings, not the top-level field #43

Merged
neerdoc merged 1 commit from macsome_2 into main 2026-07-26 19:35:55 +00:00
Owner

Live testing showed every MA playlist reports provider="library" at the
top level regardless of its actual source (MA's own internal library entry,
not the streaming account) - the real backing provider only appears in
provider_mappings. This silently broke three things:

  • Apple Music wishlist detection never matched anything, since it compared
    against "library" instead of the actual provider domain.
  • cleanup_migrated's protected-provider check (never delete Spotify/Apple
    Music-backed playlists) was comparing against "library" too, so it wasn't
    actually protecting anything.
  • The wishlist playlist itself wasn't being excluded from the normal
    MA->Plex mirror, so once it gained tracks it would start getting mirrored
    into a real Plex playlist.

Now resolves the true account from provider_mappings (first non-library
mapping) for is_native, the protected-provider check, and wishlist
detection, while still using the raw top-level provider for the MA API
calls that actually require it (get_playlist_tracks).

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

Live testing showed every MA playlist reports provider="library" at the top level regardless of its actual source (MA's own internal library entry, not the streaming account) - the real backing provider only appears in provider_mappings. This silently broke three things: - Apple Music wishlist detection never matched anything, since it compared against "library" instead of the actual provider domain. - cleanup_migrated's protected-provider check (never delete Spotify/Apple Music-backed playlists) was comparing against "library" too, so it wasn't actually protecting anything. - The wishlist playlist itself wasn't being excluded from the normal MA->Plex mirror, so once it gained tracks it would start getting mirrored into a real Plex playlist. Now resolves the true account from provider_mappings (first non-library mapping) for is_native, the protected-provider check, and wishlist detection, while still using the raw top-level provider for the MA API calls that actually require it (get_playlist_tracks). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Live testing showed every MA playlist reports provider="library" at the
top level regardless of its actual source (MA's own internal library entry,
not the streaming account) - the real backing provider only appears in
provider_mappings. This silently broke three things:

- Apple Music wishlist detection never matched anything, since it compared
  against "library" instead of the actual provider domain.
- cleanup_migrated's protected-provider check (never delete Spotify/Apple
  Music-backed playlists) was comparing against "library" too, so it wasn't
  actually protecting anything.
- The wishlist playlist itself wasn't being excluded from the normal
  MA->Plex mirror, so once it gained tracks it would start getting mirrored
  into a real Plex playlist.

Now resolves the true account from provider_mappings (first non-library
mapping) for is_native, the protected-provider check, and wishlist
detection, while still using the raw top-level provider for the MA API
calls that actually require it (get_playlist_tracks).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
WulfScience-FOSS/ha-music-own!43
No description provided.