diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-05-24 23:01:57 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-05-24 23:01:57 -0400 |
| commit | 12d47e1e9431cc9f89b135b185702f7f1b0face2 (patch) | |
| tree | dd4b95795c173085cee2f623f7f2a358e8cf131d | |
| parent | 134dc3b68b6adfe49645b9cbeca5fd19a6342266 (diff) | |
fix dlna progress reporting for wd tv
| -rw-r--r-- | MediaBrowser.Dlna/PlayTo/Device.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/MediaBrowser.Dlna/PlayTo/Device.cs b/MediaBrowser.Dlna/PlayTo/Device.cs index c41aa73a9c..222a52736c 100644 --- a/MediaBrowser.Dlna/PlayTo/Device.cs +++ b/MediaBrowser.Dlna/PlayTo/Device.cs @@ -635,15 +635,25 @@ namespace MediaBrowser.Dlna.PlayTo } XElement uPnpResponse; - + + // Handle different variations sent back by devices try { uPnpResponse = XElement.Parse(trackString); } - catch (Exception ex) + catch (Exception) { - _logger.ErrorException("Unable to parse xml {0}", ex, trackString); - return new Tuple<bool, uBaseObject>(true, null); + // first try to add a root node with a dlna namesapce + try + { + uPnpResponse = XElement.Parse("<data xmlns:dlna=\"urn:schemas-dlna-org:device-1-0\">" + trackString + "</data>"); + uPnpResponse = uPnpResponse.Descendants().First(); + } + catch (Exception ex) + { + _logger.ErrorException("Unable to parse xml {0}", ex, trackString); + return new Tuple<bool, uBaseObject>(true, null); + } } var e = uPnpResponse.Element(uPnpNamespaces.items); |
