diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-12-09 21:02:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-09 21:02:33 -0500 |
| commit | c79706efe543199c7efdaef2bc2afd8dfb9b5e61 (patch) | |
| tree | dcb5dee8328bc50978ec09fb3075d5244faad165 /Emby.Dlna/ProfileSerialization/CodecProfile.cs | |
| parent | 003650f2d669d68cd382281daa2d3af8a1a02d30 (diff) | |
| parent | e936f49518bcd6e28d44600d58205fee9c1e21fd (diff) | |
Merge pull request #2334 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Dlna/ProfileSerialization/CodecProfile.cs')
| -rw-r--r-- | Emby.Dlna/ProfileSerialization/CodecProfile.cs | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/Emby.Dlna/ProfileSerialization/CodecProfile.cs b/Emby.Dlna/ProfileSerialization/CodecProfile.cs deleted file mode 100644 index 73fbca990..000000000 --- a/Emby.Dlna/ProfileSerialization/CodecProfile.cs +++ /dev/null @@ -1,68 +0,0 @@ -using MediaBrowser.Model.Extensions; -using System.Collections.Generic; -using System.Xml.Serialization; -using MediaBrowser.Model.Dlna; - -namespace Emby.Dlna.ProfileSerialization -{ - public class CodecProfile - { - [XmlAttribute("type")] - public CodecType Type { get; set; } - - public ProfileCondition[] Conditions { get; set; } - - public ProfileCondition[] ApplyConditions { get; set; } - - [XmlAttribute("codec")] - public string Codec { get; set; } - - [XmlAttribute("container")] - public string Container { get; set; } - - public CodecProfile() - { - Conditions = new ProfileCondition[] {}; - ApplyConditions = new ProfileCondition[] { }; - } - - public List<string> GetCodecs() - { - List<string> list = new List<string>(); - foreach (string i in (Codec ?? string.Empty).Split(',')) - { - if (!string.IsNullOrEmpty(i)) list.Add(i); - } - return list; - } - - 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); - } - } -} |
