Skip to content

Commit e5c4bbe

Browse files
authored
Fix album image missing from queue item responses (music-assistant#3302)
1 parent ac512a6 commit e5c4bbe

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • music_assistant/controllers/media

music_assistant/controllers/media/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,8 +1109,10 @@ def _parse_db_row(db_row: Mapping[str, Any]) -> dict[str, Any]:
11091109
if (album_images := track_album.get("images")) and (
11101110
album_thumb := next((x for x in album_images if x["type"] == "thumb"), None)
11111111
):
1112-
# copy album image to itemmapping single image
1112+
# copy album image to itemmapping single image (on the track)
11131113
db_row_dict["image"] = album_thumb
1114+
# also set image on the album dict for ItemMapping compatibility
1115+
track_album["image"] = album_thumb
11141116
if db_row_dict["metadata"].get("images"):
11151117
# merge album image with existing images
11161118
db_row_dict["metadata"]["images"] = [
@@ -1119,6 +1121,7 @@ def _parse_db_row(db_row: Mapping[str, Any]) -> dict[str, Any]:
11191121
]
11201122
else:
11211123
db_row_dict["metadata"]["images"] = [album_thumb]
1124+
11221125
return db_row_dict
11231126

11241127
@final

0 commit comments

Comments
 (0)