diff --git a/music_assistant/server/controllers/media/base.py b/music_assistant/server/controllers/media/base.py index 32e82d13b..a30106ffa 100644 --- a/music_assistant/server/controllers/media/base.py +++ b/music_assistant/server/controllers/media/base.py @@ -717,4 +717,9 @@ def _parse_db_row(db_row: Mapping) -> dict[str, Any]: "version": db_row_dict["album_version"], } db_row_dict["album"] = ItemMapping.from_dict(db_row_dict["album"]) + if db_row_dict["album_metadata"]: + # copy album image + album_metadata = json_loads(db_row_dict["album_metadata"]) + if album_metadata and album_metadata["images"]: + db_row_dict["metadata"]["images"] = album_metadata["images"] return db_row_dict diff --git a/music_assistant/server/controllers/media/tracks.py b/music_assistant/server/controllers/media/tracks.py index fe4e86420..7892117da 100644 --- a/music_assistant/server/controllers/media/tracks.py +++ b/music_assistant/server/controllers/media/tracks.py @@ -137,9 +137,11 @@ async def add_item_to_library(self, item: Track, metadata_lookup: bool = True) - and item.album.image and item.album.album_type == AlbumType.SINGLE ): - if not item.metadata.images: - item.metadata.images = [] - item.metadata.images.append(item.album.image) + item.metadata.images = item.album.metadata.images + elif item.image and isinstance(item.album, Album) and item.image == item.album.image: + item.metadata.images = [] + if item.image and isinstance(item.album, Album) and not item.album.image: + item.album.metadata.images = item.metadata.images # actually add (or update) the item in the library db # use the lock to prevent a race condition of the same item being added twice async with self._db_add_lock: diff --git a/music_assistant/server/providers/tidal/__init__.py b/music_assistant/server/providers/tidal/__init__.py index 9e020e222..f6a471558 100644 --- a/music_assistant/server/providers/tidal/__init__.py +++ b/music_assistant/server/providers/tidal/__init__.py @@ -616,6 +616,13 @@ async def _parse_track( track.metadata.lyrics = lyrics_obj.text except Exception: self.logger.info(f"Track {track_obj.id} has no available lyrics") + if not track.image and track_obj.album and (image_url := track_obj.album.image(640, None)): + track.metadata.images = [ + MediaItemImage( + type=ImageType.THUMB, + path=image_url, + ) + ] return track async def _parse_playlist(