Fix editability for owned YouTube Music playlists - #5187
Conversation
|
✅ The title and description are good to go. Thanks! |
|
Closing this draft after reviewing the project AI Policy, which does not allow autonomous agents to submit contributions. The tested branch remains available for Seppe to review and submit personally if desired. |
There was a problem hiding this comment.
Pull request overview
This PR fixes YouTube Music playlist editability detection by treating the new owned flag (when present) as the primary signal for whether a library playlist is editable, while preserving the existing privacy == "PRIVATE" fallback for older/pinned ytmusicapi response shapes.
Changes:
- Update
YoutubeMusicProvider._parse_playlistto preferplaylist_obj["owned"]foris_editable, falling back to the previousprivacyheuristic whenownedis absent. - Add a regression test ensuring an owned playlist remains editable even when
privacyis missing from the library playlist payload.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
music_assistant/providers/ytmusic/__init__.py |
Switches editability inference to prefer the owned flag while retaining the existing privacy fallback. |
tests/providers/ytmusic/test_ytmusic.py |
Adds a regression test covering owned-playlist editability when privacy is omitted. |
|
Thanks for this PR! The fix looks sane, but we do need this to be merged and released upstream first in |
|
Thanks! I’ve updated sigma67/ytmusicapi#972 and addressed its review feedback. It is currently waiting for upstream workflow approval and maintainer review. I’ll keep this PR as a draft and mark it ready again once a released ytmusicapi version includes |
|
Hi @MarvinSchenkel, the upstream PR sigma67/ytmusicapi#972 has been merged. A released ytmusicapi version including the |
MarvinSchenkel
left a comment
There was a problem hiding this comment.
Great stuff, thanks @seppegadeyne 🙏
What does this implement/fix?
YouTube Music library playlist objects do not include
privacy, so owned playlists were imported as read-only. This change uses the playlistownedflag as the editability signal when available, while retaining the existing private-playlist fallback for compatibility with the currently pinned ytmusicapi response shape.This depends on ytmusicapi #972 exposing
ownedfor library playlists. It is safe to merge before that dependency is released because responses withoutownedkeep the existing behavior.A regression test verifies that an owned playlist remains editable when
privacyis absent.Related issue (if applicable):
Types of changes
bugfixnew-featureenhancementnew-providerbreaking-changerefactordocumentationmaintenancecidependenciesChecklist
pre-commit run --all-filespasses.pytestpasses, and tests have been added/updated undertests/where applicable.music-assistant/modelsis linked.music-assistant/frontendis linked.