From 47edb9884ca65b3fd27e57d57d5aa322767e6804 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Sat, 9 Jul 2022 10:45:28 +0200 Subject: [PATCH] Youtube Music: Fix artist missing on compilation albums (#403) Fix artist missing on compilation albums --- music_assistant/music_providers/ytmusic/ytmusic.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/music_assistant/music_providers/ytmusic/ytmusic.py b/music_assistant/music_providers/ytmusic/ytmusic.py index ed4910a45..8503557cf 100644 --- a/music_assistant/music_providers/ytmusic/ytmusic.py +++ b/music_assistant/music_providers/ytmusic/ytmusic.py @@ -325,7 +325,10 @@ async def _parse_album(self, album_obj: dict, album_id: str) -> Album: album.artists = [ await self._parse_artist(artist) for artist in album_obj["artists"] - if artist.get("id") + # artist object may be missing an id + # in that case its either a performer (like the composer) OR this + # is a Various artists compilation album... + if (artist.get("id") or artist["name"] == "Various Artists") ] if "type" in album_obj: if album_obj["type"] == "Single":