Skip to content

Fix album art on Music Assistant 2.10+ - #99

Open
lotooo wants to merge 1 commit into
CollotsSpot:masterfrom
lotooo:fix/imageproxy-proxy-id
Open

lotooo wants to merge 1 commit into
CollotsSpot:masterfrom
lotooo:fix/imageproxy-proxy-id

Conversation

@lotooo

@lotooo lotooo commented Sep 22, 2026

Copy link
Copy Markdown

Album art fails to load on Music Assistant 2.10+: MA replaced the
/imageproxy?path=&provider= form with /imageproxy/<proxy_id> and removed the
old one, so every artwork request now returns HTTP 400.

getImageUrl() now uses proxy_id when the server sends it and keeps the legacy
query form as a fallback, so the same build works against pre- and post-2.10
servers with no version check.

Details

Root cause — in MA 2.10.4 (controllers/metadata/images.py) the only
registered route is /imageproxy/*, and handle_imageproxy() requires a
64-char hex id taken from MediaItemImage.proxy_id. A request to
/imageproxy?path=…&provider=… never matches the /imageproxy/ prefix and
returns a bare 400 with an empty body — which is exactly what the app logs:

Error loading artUri: HttpException: Invalid statusCode: 400,
uri = https://<server>/imageproxy?provider=deezer--…&size=512&fmt=jpeg&path=https%3A%2F%2Fcdn-images.dzcdn.net%2F…

Sizes — MA only accepts {0, 80, 160, 256, 512, 1024} and 400s on anything
else. Call sites in this repo pass 80, 128, 256 and 512, so 128 would have
failed; _imageProxySize() rounds up to the nearest accepted value.

The two re-host sites in music_assistant_provider.dart rebuilt a URL as
'$baseUrl/imageproxy?$queryString', keeping only the query and discarding the
path. Given a 2.10 URL that collapses /imageproxy/<id>?size=512 to
/imageproxy?size=512, another 400. They now preserve imgUri.path, which is
equivalent to the old behaviour on pre-2.10 servers.

Verified against a live MA 2.10.4 server (schema 65). Using a real
proxy_id pulled from player_queues/all:

URL Result
/imageproxy/<proxy_id>?size=512&fmt=jpeg 200 image/jpeg, 21 982 b
/imageproxy/<proxy_id>?size=128 (unclamped) 400
/imageproxy?path=…&provider=… (before this PR) 400, empty body

Clamped sizes 80/160/256/512 all return 200. Not compile-checked — no Flutter
toolchain was available where this was written.

MA 2.10 replaced /imageproxy?path=&provider= with /imageproxy/<proxy_id>
and removed the old form, so every artwork request returned HTTP 400.

Use proxy_id when the server sends it and keep the legacy query form as a
fallback for pre-2.10 servers. Sizes are rounded up to the set MA accepts
(80/160/256/512/1024), since callers also ask for 128.

The two places that re-point an MA-built image URL at the configured server
now keep the original path instead of only its query string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant