Skip to content

Commit

Permalink
tweak for album thumb
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Feb 16, 2025
1 parent 4530c45 commit 82565d4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions music_assistant/controllers/player_queues.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ async def _load_item(
)
)
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(
Expand All @@ -1038,6 +1039,16 @@ async def _load_item(
# 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(
Expand Down

0 comments on commit 82565d4

Please sign in to comment.