Make Plex Wish List sync one-way (add-only) and fix silent-failure logging #44

Merged
neerdoc merged 1 commit from macsome_3 into main 2026-07-27 09:07:14 +00:00
Owner

Verified against Music Assistant's own source: the Apple Music provider's
remove_playlist_tracks unconditionally raises ("Removing tracks from
playlists is not supported by the Apple Music API. Make sure to delete
them using the Apple Music app."), so the previous add+remove design could
never actually remove anything - it would just fail and log a warning every
sync. sync_wishlist_playlist now only adds, and reports a "stale" count
(tracks that are no longer wanted but can't be auto-removed) via
sensor.plex_wish_list's new stale_needs_manual_removal attribute instead.

Also fixes a real observability gap: fetch_ma_playlists and
sync_wishlist_playlist could both return without logging anything in some
branches, making a "wishlist playlist not found" case indistinguishable
from "found but nothing to do" by log inspection alone. Both paths now log
unconditionally. Also documented that Music Assistant does not appear to
index empty playlists into its library - the wishlist playlist needs at
least one track before it'll ever be picked up by get_library_playlists().

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

Verified against Music Assistant's own source: the Apple Music provider's remove_playlist_tracks unconditionally raises ("Removing tracks from playlists is not supported by the Apple Music API. Make sure to delete them using the Apple Music app."), so the previous add+remove design could never actually remove anything - it would just fail and log a warning every sync. sync_wishlist_playlist now only adds, and reports a "stale" count (tracks that are no longer wanted but can't be auto-removed) via sensor.plex_wish_list's new stale_needs_manual_removal attribute instead. Also fixes a real observability gap: fetch_ma_playlists and sync_wishlist_playlist could both return without logging anything in some branches, making a "wishlist playlist not found" case indistinguishable from "found but nothing to do" by log inspection alone. Both paths now log unconditionally. Also documented that Music Assistant does not appear to index empty playlists into its library - the wishlist playlist needs at least one track before it'll ever be picked up by get_library_playlists(). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Verified against Music Assistant's own source: the Apple Music provider's
remove_playlist_tracks unconditionally raises ("Removing tracks from
playlists is not supported by the Apple Music API. Make sure to delete
them using the Apple Music app."), so the previous add+remove design could
never actually remove anything - it would just fail and log a warning every
sync. sync_wishlist_playlist now only adds, and reports a "stale" count
(tracks that are no longer wanted but can't be auto-removed) via
sensor.plex_wish_list's new stale_needs_manual_removal attribute instead.

Also fixes a real observability gap: fetch_ma_playlists and
sync_wishlist_playlist could both return without logging anything in some
branches, making a "wishlist playlist not found" case indistinguishable
from "found but nothing to do" by log inspection alone. Both paths now log
unconditionally. Also documented that Music Assistant does not appear to
index empty playlists into its library - the wishlist playlist needs at
least one track before it'll ever be picked up by get_library_playlists().

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!44
No description provided.