Subsonic: Reorder image metadata for artists (#3227)
authorEric Munson <eric@munsonfam.org>
Tue, 24 Feb 2026 07:28:07 +0000 (02:28 -0500)
committerGitHub <noreply@github.com>
Tue, 24 Feb 2026 07:28:07 +0000 (08:28 +0100)
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 <eric@munsonfam.org>
music_assistant/providers/opensubsonic/parsers.py
tests/providers/opensubsonic/__snapshots__/test_parsers.ambr

index 56ee89afa6cb28fd5d87afe06c219f09ea3969bc..c8fc8e1990347013eb13be348c5ebfc57a3a78f9 100644 (file)
@@ -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
index 0acfe2af5ca3b0f3148fbfdf11654b5c056fc9a0..b849ad14d179c2c4fb900c345e2c8a56c6f76ef5 100644 (file)
       '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',
         }),
       ]),
       '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({
       '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',
         }),
       ]),
       '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({