Youtube Music: Fix artist missing on compilation albums (#403)
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 9 Jul 2022 08:45:28 +0000 (10:45 +0200)
committerGitHub <noreply@github.com>
Sat, 9 Jul 2022 08:45:28 +0000 (10:45 +0200)
Fix artist missing on compilation albums

music_assistant/music_providers/ytmusic/ytmusic.py

index ed4910a453c1fc5fe5f20f2791e3565db011ee53..8503557cf057895b47a830aa984b85f22b132953 100644 (file)
@@ -325,7 +325,10 @@ class YoutubeMusicProvider(MusicProvider):
             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":