[PR #9759] Rescue malformed Xml response in DLNA PlayTo #12215

Closed
opened 2026-02-07 06:52:00 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/jellyfin/jellyfin/pull/9759

State: closed
Merged: Yes


Not all devices (TVs/Receivers/Tuners) appear to provide well-formed Xml responses when using the 'remote control' / 'PlayTo' functionality. Currently, in such cases Jellyfin becomes unable to provide remote control or song progress, behaving like nothing happened (while the remote device starts playing), and throws an exception in the log.
In this PR, when the XmlException is caught, it tries to escape unescaped & characters and then retries to read the Xml. If the Xml is now correct, Jellyfin will operate normally - if it is still not correct it will log the XmlException after all.

Changes
Add regex expression to the exception handler in DlnaHttpClient's SendRequestAsync function. Adding it there avoids interrupting the normal flow, but provides a rescue scenario for communicating with ill-behaving equipment.
Regex currently fixes unescaped ampersands, other corrections could easily be added.

Issues
Described in jellyfin/jellyfin-plugin-dlna#26. I'm not sure it fixes the original Bose issue, but does correct the behaviour with my amplifier.

**Original Pull Request:** https://github.com/jellyfin/jellyfin/pull/9759 **State:** closed **Merged:** Yes --- Not all devices (TVs/Receivers/Tuners) appear to provide well-formed Xml responses when using the 'remote control' / 'PlayTo' functionality. Currently, in such cases Jellyfin becomes unable to provide remote control or song progress, behaving like nothing happened (while the remote device starts playing), and throws an exception in the log. In this PR, when the XmlException is caught, it tries to escape unescaped & characters and then retries to read the Xml. If the Xml is now correct, Jellyfin will operate normally - if it is still not correct it will log the XmlException after all. **Changes** Add regex expression to the exception handler in DlnaHttpClient's SendRequestAsync function. Adding it there avoids interrupting the normal flow, but provides a rescue scenario for communicating with ill-behaving equipment. Regex currently fixes unescaped ampersands, other corrections could easily be added. **Issues** Described in jellyfin/jellyfin-plugin-dlna#26. I'm not sure it fixes the original Bose issue, but does correct the behaviour with my amplifier.
OVERLORD added the pull-request label 2026-02-07 06:52:00 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#12215