From e6d9d240e48ebdd0dcf2825d0c0cda60a431fb6f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 6 May 2015 23:11:51 -0400 Subject: fix xbox one browser access --- MediaBrowser.Model/Dlna/CodecProfile.cs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Model/Dlna/CodecProfile.cs') diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs index c2d36dc792..7200f648cd 100644 --- a/MediaBrowser.Model/Dlna/CodecProfile.cs +++ b/MediaBrowser.Model/Dlna/CodecProfile.cs @@ -14,6 +14,9 @@ namespace MediaBrowser.Model.Dlna [XmlAttribute("codec")] public string Codec { get; set; } + [XmlAttribute("container")] + public string Container { get; set; } + public CodecProfile() { Conditions = new ProfileCondition[] {}; @@ -29,8 +32,30 @@ namespace MediaBrowser.Model.Dlna return list; } - public bool ContainsCodec(string codec) + public List GetContainers() + { + List list = new List(); + foreach (string i in (Container ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) list.Add(i); + } + return list; + } + + private bool ContainsContainer(string container) + { + List containers = GetContainers(); + + return containers.Count == 0 || ListHelper.ContainsIgnoreCase(containers, container ?? string.Empty); + } + + public bool ContainsCodec(string codec, string container) { + if (!ContainsContainer(container)) + { + return false; + } + List codecs = GetCodecs(); return codecs.Count == 0 || ListHelper.ContainsIgnoreCase(codecs, codec); -- cgit v1.2.3