From 0b70a7ae8db49722e563be54425ab2fbd7c7c916 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Wed, 11 May 2022 22:38:07 +0200 Subject: [PATCH] Fix KeyError when retrieving full album object (#308) --- music_assistant/controllers/music/albums.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/music_assistant/controllers/music/albums.py b/music_assistant/controllers/music/albums.py index 996c0be6..3b3e7d09 100644 --- a/music_assistant/controllers/music/albums.py +++ b/music_assistant/controllers/music/albums.py @@ -32,9 +32,10 @@ class AlbumsController(MediaControllerBase[Album]): """Return (full) details for a single media item.""" album = await super().get(*args, **kwargs) # append full artist details to full album item - album.artist = await self.mass.music.artists.get( - album.artist.item_id, album.artist.provider - ) + if album.artist: + album.artist = await self.mass.music.artists.get( + album.artist.item_id, album.artist.provider + ) return album async def tracks(self, item_id: str, provider_id: str) -> List[Track]: -- 2.34.1