Skip to content

Fix editability for owned YouTube Music playlists - #5187

Merged
MarvinSchenkel merged 3 commits into
music-assistant:devfrom
seppegadeyne:fix/ytmusic-owned-playlist-editability
Aug 17, 2026
Merged

Fix editability for owned YouTube Music playlists#5187
MarvinSchenkel merged 3 commits into
music-assistant:devfrom
seppegadeyne:fix/ytmusic-owned-playlist-editability

Conversation

@seppegadeyne

@seppegadeyne seppegadeyne commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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 playlist owned flag 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 owned for library playlists. It is safe to merge before that dependency is released because responses without owned keep the existing behavior.

A regression test verifies that an owned playlist remains editable when privacy is absent.

Related issue (if applicable):

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • New music/player/metadata/plugin provider — new-provider
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — breaking-change
  • Refactor (no behaviour change) — refactor
  • Documentation only — documentation
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Checklist

  • The code change is tested and works locally.
  • pre-commit run --all-files passes.
  • pytest passes, and tests have been added/updated under tests/ where applicable.
  • For changes to shared models, the companion PR in music-assistant/models is linked.
  • For changes affecting the UI, the companion PR in music-assistant/frontend is linked.
  • I have read and complied with the project's AI Policy for any AI-assisted contributions.
  • I have raised a PR against the documentation repository targeting the main or beta branch as appropriate.

@musicassistant-bot

musicassistant-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

✅ The title and description are good to go. Thanks!

@seppegadeyne

Copy link
Copy Markdown
Contributor Author

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.

@seppegadeyne seppegadeyne reopened this Jul 31, 2026
@seppegadeyne
seppegadeyne marked this pull request as ready for review July 31, 2026 19:43
Copilot AI balanced review requested due to automatic review settings July 31, 2026 19:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_playlist to prefer playlist_obj["owned"] for is_editable, falling back to the previous privacy heuristic when owned is absent.
  • Add a regression test ensuring an owned playlist remains editable even when privacy is 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.

Copilot AI review requested due to automatic review settings July 31, 2026 19:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@MarvinSchenkel

Copy link
Copy Markdown
Contributor

Thanks for this PR! The fix looks sane, but we do need this to be merged and released upstream first in ytmusicapi. I will mark this PR as draft. Please mark it as 'ready for review' again once your upstream changes are released so we can also include it in MA 🙏

@seppegadeyne

Copy link
Copy Markdown
Contributor Author

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 owned.

@seppegadeyne

Copy link
Copy Markdown
Contributor Author

Hi @MarvinSchenkel, the upstream PR sigma67/ytmusicapi#972 has been merged. A released ytmusicapi version including the owned flag should now be available soon. Marking this PR as ready for review again so it can be picked up on the MA side. 🙏

@seppegadeyne
seppegadeyne marked this pull request as ready for review August 10, 2026 07:18

@MarvinSchenkel MarvinSchenkel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, thanks @seppegadeyne 🙏

Copilot AI review requested due to automatic review settings August 17, 2026 20:34
@MarvinSchenkel
MarvinSchenkel enabled auto-merge (squash) August 17, 2026 20:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@MarvinSchenkel
MarvinSchenkel merged commit d4fdd86 into music-assistant:dev Aug 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants