diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-09-27 10:51:36 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-09-27 10:51:36 -0400 |
| commit | f1371b17d82eb819bdae679be635588ed364d2de (patch) | |
| tree | 59139f37a699a7c76445725e7ab8f67aa34440c8 | |
| parent | a0d82a02c8059dbacacac727d334b3d39c052a48 (diff) | |
improve dlna device status reporting
| -rw-r--r-- | Emby.Dlna/PlayTo/Device.cs | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs index b6b1c0c03..165f123f1 100644 --- a/Emby.Dlna/PlayTo/Device.cs +++ b/Emby.Dlna/PlayTo/Device.cs @@ -662,7 +662,33 @@ namespace Emby.Dlna.PlayTo var e = track.Element(uPnpNamespaces.items) ?? track; - return UpnpContainer.Create(e); + var elementString = (string)e; + + if (!string.IsNullOrWhiteSpace(elementString)) + { + return UpnpContainer.Create(e); + } + + track = result.Document.Descendants("CurrentURI").FirstOrDefault(); + + if (track == null) + { + return null; + } + + e = track.Element(uPnpNamespaces.items) ?? track; + + elementString = (string)e; + + if (!string.IsNullOrWhiteSpace(elementString)) + { + return new uBaseObject + { + Url = elementString + }; + } + + return null; } private async Task<Tuple<bool, uBaseObject>> GetPositionInfo() @@ -720,7 +746,7 @@ namespace Emby.Dlna.PlayTo if (string.IsNullOrWhiteSpace(trackString) || string.Equals(trackString, "NOT_IMPLEMENTED", StringComparison.OrdinalIgnoreCase)) { - return new Tuple<bool, uBaseObject>(false, null); + return new Tuple<bool, uBaseObject>(true, null); } XElement uPnpResponse; |
