tweak for album thumb
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 16 Feb 2025 23:40:16 +0000 (00:40 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 16 Feb 2025 23:40:16 +0000 (00:40 +0100)
music_assistant/controllers/player_queues.py

index 7a570ec985c341330f6326f10e32ce7c065a4194..653b6820fa334baea568bd892959f38ba61d553f 100644 (file)
@@ -1024,6 +1024,7 @@ class PlayerQueuesController(CoreController):
             )
         )
         if queue_item.media_item and queue_item.media_item.media_type == MediaType.TRACK:
+            album = queue_item.media_item.album
             # prefer the full library media item so we have all metadata and provider(quality) info
             # always request the full library item as there might be other qualities available
             if library_item := await self.mass.music.get_library_item_by_prov_id(
@@ -1038,6 +1039,16 @@ class PlayerQueuesController(CoreController):
                 # Youtube Music has poor thumbs by default, so we always fetch the full item
                 # this also catches the case where they have an unavailable item in a listing
                 queue_item.media_item = await self.mass.music.get_item_by_uri(queue_item.uri)
+            # ensure we got the original album set
+            if album and library_item.album and album.item_id != library_item.album.item_id:
+                if library_album := await self.mass.music.get_library_item_by_prov_id(
+                    album.media_type,
+                    album.item_id,
+                    album.provider,
+                ):
+                    queue_item.media_item.album = library_album
+                else:
+                    queue_item.media_item.album = album
         # Fetch the streamdetails, which could raise in case of an unplayable item.
         # For example, YT Music returns Radio Items that are not playable.
         queue_item.streamdetails = await get_stream_details(