From 12d47e1e9431cc9f89b135b185702f7f1b0face2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 24 May 2015 23:01:57 -0400 Subject: [PATCH] fix dlna progress reporting for wd tv --- MediaBrowser.Dlna/PlayTo/Device.cs | 18 ++++++++++++++---- 1 file 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(true, null); + // first try to add a root node with a dlna namesapce + try + { + uPnpResponse = XElement.Parse("" + trackString + ""); + uPnpResponse = uPnpResponse.Descendants().First(); + } + catch (Exception ex) + { + _logger.ErrorException("Unable to parse xml {0}", ex, trackString); + return new Tuple(true, null); + } } var e = uPnpResponse.Element(uPnpNamespaces.items);