jellyfin/MediaBrowser.Model/Dlna/ContainerProfile.cs

40 lines
1.1 KiB
C#
Raw Normal View History

2014-03-23 17:42:02 +01:00
using System.Collections.Generic;
2014-03-26 16:06:48 +01:00
using System.Xml.Serialization;
2016-12-09 08:23:09 +01:00
using MediaBrowser.Model.Dlna;
2016-12-13 18:04:37 +01:00
using MediaBrowser.Model.Extensions;
2014-03-23 17:42:02 +01:00
2014-04-02 00:23:07 +02:00
namespace MediaBrowser.Model.Dlna
2014-03-23 17:42:02 +01:00
{
public class ContainerProfile
{
2016-12-09 08:23:09 +01:00
[XmlAttribute("type")]
2014-03-23 17:42:02 +01:00
public DlnaProfileType Type { get; set; }
public ProfileCondition[] Conditions { get; set; }
2014-03-26 16:06:48 +01:00
2016-12-09 08:23:09 +01:00
[XmlAttribute("container")]
2014-03-23 17:42:02 +01:00
public string Container { get; set; }
public ContainerProfile()
{
Conditions = new ProfileCondition[] { };
}
public List<string> GetContainers()
{
2014-05-08 23:23:24 +02:00
List<string> list = new List<string>();
foreach (string i in (Container ?? string.Empty).Split(','))
{
if (!string.IsNullOrEmpty(i)) list.Add(i);
}
return list;
2014-03-23 17:42:02 +01:00
}
2016-12-13 18:04:37 +01:00
public bool ContainsContainer(string container)
{
List<string> containers = GetContainers();
return containers.Count == 0 || ListHelper.ContainsIgnoreCase(containers, container ?? string.Empty);
}
2014-03-23 17:42:02 +01:00
}
}