From: Eric Munson Date: Tue, 24 Feb 2026 07:28:07 +0000 (-0500) Subject: Subsonic: Reorder image metadata for artists (#3227) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=06087c901e29fcec9418526077f8ac005717ab51;p=music-assistant-server.git Subsonic: Reorder image metadata for artists (#3227) I am seeing a number of places where MA is asking the subsonic server for images using the full URL to lastfm. Reorder the insertion of images in these parsers to place the subsonic image first incase this encourages MA to use that entry instead. Signed-off-by: Eric B Munson --- diff --git a/music_assistant/providers/opensubsonic/parsers.py b/music_assistant/providers/opensubsonic/parsers.py index 56ee89af..c8fc8e19 100644 --- a/music_assistant/providers/opensubsonic/parsers.py +++ b/music_assistant/providers/opensubsonic/parsers.py @@ -221,25 +221,26 @@ def parse_artist( """Parse artist and artistInfo into a Music Assistant Artist.""" metadata: MediaItemMetadata = MediaItemMetadata() - if sonic_artist.artist_image_url: + if sonic_artist.cover_art: metadata.add_image( MediaItemImage( type=ImageType.THUMB, - path=sonic_artist.artist_image_url, + path=sonic_artist.cover_art, provider=instance_id, - remotely_accessible=True, + remotely_accessible=False, ) ) - if sonic_artist.cover_art: + if sonic_artist.artist_image_url: metadata.add_image( MediaItemImage( type=ImageType.THUMB, - path=sonic_artist.cover_art, + path=sonic_artist.artist_image_url, provider=instance_id, - remotely_accessible=False, + remotely_accessible=True, ) ) + if sonic_info: if sonic_info.biography: metadata.description = sonic_info.biography diff --git a/tests/providers/opensubsonic/__snapshots__/test_parsers.ambr b/tests/providers/opensubsonic/__snapshots__/test_parsers.ambr index 0acfe2af..b849ad14 100644 --- a/tests/providers/opensubsonic/__snapshots__/test_parsers.ambr +++ b/tests/providers/opensubsonic/__snapshots__/test_parsers.ambr @@ -823,15 +823,15 @@ 'grouping': None, 'images': list([ dict({ - 'path': 'https://demo.org/image.jpg', + 'path': 'ar-37ec820ca7193e17040c98f7da7c4b51_0', 'provider': 'xx-instance-id-xx', - 'remotely_accessible': True, + 'remotely_accessible': False, 'type': 'thumb', }), dict({ - 'path': 'ar-37ec820ca7193e17040c98f7da7c4b51_0', + 'path': 'https://demo.org/image.jpg', 'provider': 'xx-instance-id-xx', - 'remotely_accessible': False, + 'remotely_accessible': True, 'type': 'thumb', }), ]), @@ -901,15 +901,15 @@ 'grouping': None, 'images': list([ dict({ - 'path': 'https://demo.org/image.jpg', + 'path': 'ar-37ec820ca7193e17040c98f7da7c4b51_0', 'provider': 'xx-instance-id-xx', - 'remotely_accessible': True, + 'remotely_accessible': False, 'type': 'thumb', }), dict({ - 'path': 'ar-37ec820ca7193e17040c98f7da7c4b51_0', + 'path': 'https://demo.org/image.jpg', 'provider': 'xx-instance-id-xx', - 'remotely_accessible': False, + 'remotely_accessible': True, 'type': 'thumb', }), dict({ @@ -985,15 +985,15 @@ 'grouping': None, 'images': list([ dict({ - 'path': 'https://demo.org/image.jpg', + 'path': 'ar-37ec820ca7193e17040c98f7da7c4b51_0', 'provider': 'xx-instance-id-xx', - 'remotely_accessible': True, + 'remotely_accessible': False, 'type': 'thumb', }), dict({ - 'path': 'ar-37ec820ca7193e17040c98f7da7c4b51_0', + 'path': 'https://demo.org/image.jpg', 'provider': 'xx-instance-id-xx', - 'remotely_accessible': False, + 'remotely_accessible': True, 'type': 'thumb', }), ]), @@ -1063,15 +1063,15 @@ 'grouping': None, 'images': list([ dict({ - 'path': 'https://demo.org/image.jpg', + 'path': 'ar-37ec820ca7193e17040c98f7da7c4b51_0', 'provider': 'xx-instance-id-xx', - 'remotely_accessible': True, + 'remotely_accessible': False, 'type': 'thumb', }), dict({ - 'path': 'ar-37ec820ca7193e17040c98f7da7c4b51_0', + 'path': 'https://demo.org/image.jpg', 'provider': 'xx-instance-id-xx', - 'remotely_accessible': False, + 'remotely_accessible': True, 'type': 'thumb', }), dict({