Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion music_assistant/providers/ytmusic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ def _parse_playlist(self, playlist_obj: dict[str, Any]) -> Playlist:
raw_playlist_id = playlist_obj["id"]
playlist_id = raw_playlist_id
playlist_name = playlist_obj["title"]
is_editable = playlist_obj.get("privacy", "") == "PRIVATE"
is_editable = playlist_obj.get("owned", playlist_obj.get("privacy", "") == "PRIVATE")
# Playlist ID's are not unique across instances for lists like 'Likes', 'Supermix', etc.
# So suffix with the instance id to make them unique
if playlist_id in YT_PERSONAL_PLAYLISTS:
Expand Down
15 changes: 15 additions & 0 deletions tests/providers/ytmusic/test_ytmusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,18 @@ async def test_sync_library_keeps_other_errors_silent(provider: YoutubeMusicProv
):
await provider.sync_library(MediaType.PLAYLIST)
provider.unload_with_error.assert_not_called()


def test_parse_owned_playlist_is_editable_without_privacy(
provider: YoutubeMusicProvider,
) -> None:
"""An owned playlist is editable even when the library response omits privacy."""
playlist = provider._parse_playlist(
{
"id": "PL_owned",
"title": "Owned playlist",
"owned": True,
}
)

assert playlist.is_editable is True