Add albumArtURI to MusicTrack didl_properties_defs#45
Add albumArtURI to MusicTrack didl_properties_defs#45StevenLooman merged 2 commits intoStevenLooman:masterfrom
Conversation
albumArtURI is a standard UPnP/DLNA field commonly used by music players (e.g., Kodi, Home Assistant dlna_dmr) to display cover art during playback. Without this entry in didl_properties_defs, the field is silently dropped during to_xml() serialization even when set on the object. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thank you for this PR @RicterZ.
I don't think this is true. The didl-lite-v2.xsd does not include this property, and therefore it wasn't included in this library when I implemented this library. Please show me the spec supporting this claim.
This is more likely to be true. Still, why would a track have album art? Surely an album would have it, but a track seems less likely to me. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #45 +/- ##
=======================================
Coverage 94.60% 94.60%
=======================================
Files 3 3
Lines 408 408
Branches 46 46
=======================================
Hits 386 386
Misses 12 12
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hey @StevenLooman , You're right that As for why a track needs it: a control point browsing a flat track list has no guarantee the parent album is available in the same response. This library already acknowledged this in v1.2.0 (
This PR simply promotes it from a silently-tolerated unknown property to a formally defined one. Kodi, Home Assistant's |
|
Thank you for pointing to the I'll merge the PR once you've created a Towncrier file. I see that the instructions for this are missing in this repo. I'll add these soon. In the mean time, see https://github.com/StevenLooman/async_upnp_client/?tab=readme-ov-file#changes for the instructions. Or see the output of the failed action for what is expected regarding the filename. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks! |
|
I'll create a release for this and async-upnp-client when StevenLooman/async_upnp_client#296 is merged. |
Problem
MusicTrack.didl_properties_defsdoes not includealbumArtURI, even though it is a standard UPnP/DLNA metadata field widely used bymusic players to display cover art during playback.
Because
to_xml()strictly iterates overdidl_properties_defs, any value set onalbum_art_uriis silently dropped duringserialization — it never appears in the generated DIDL-Lite XML. This affects any DLNA controller that sets
albumArtURIon aMusicTrackobject, including:dlna_dmrintegration viaasync_upnp_client)The field is already defined on
MusicAlbum(container), but was missing fromMusicTrack(item).Fix
Add
("upnp", "albumArtURI", "O")toMusicTrack.didl_properties_defs.Tested
Verified end-to-end with Home Assistant
dlna_dmr→ Xiaomi TV (UPnP AVTransport): after this fix,<upnp:albumArtURI>appears correctlyin the
CurrentURIMetaDataSOAP payload and cover art is displayed on the TV.