aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Dlna/CodecProfile.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-05-06 23:11:51 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-05-06 23:11:51 -0400
commite6d9d240e48ebdd0dcf2825d0c0cda60a431fb6f (patch)
treea9127e7395e0202b915034bd93ef70a5741e421f /MediaBrowser.Model/Dlna/CodecProfile.cs
parent6c97afef23856890bed55759363c7b7516f99921 (diff)
fix xbox one browser access
Diffstat (limited to 'MediaBrowser.Model/Dlna/CodecProfile.cs')
-rw-r--r--MediaBrowser.Model/Dlna/CodecProfile.cs27
1 files changed, 26 insertions, 1 deletions
diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs
index c2d36dc79..7200f648c 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<string> GetContainers()
+ {
+ List<string> list = new List<string>();
+ foreach (string i in (Container ?? string.Empty).Split(','))
+ {
+ if (!string.IsNullOrEmpty(i)) list.Add(i);
+ }
+ return list;
+ }
+
+ private bool ContainsContainer(string container)
+ {
+ List<string> 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<string> codecs = GetCodecs();
return codecs.Count == 0 || ListHelper.ContainsIgnoreCase(codecs, codec);