#pragma warning disable CA1819 // Properties should not return arrays
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dlna;
///
/// Defines the .
///
public class ContainerProfile
{
///
/// Gets or sets the which this container must meet.
///
[XmlAttribute("type")]
public DlnaProfileType Type { get; set; }
///
/// Gets or sets the list of which this container will be applied to.
///
public ProfileCondition[] Conditions { get; set; } = [];
///
/// Gets or sets the container(s) which this container must meet.
///
[XmlAttribute("container")]
public string? Container { get; set; }
///
/// Gets or sets the sub container(s) which this container must meet.
///
[XmlAttribute("subcontainer")]
public string? SubContainer { get; set; }
///
/// Returns true if an item in appears in the property.
///
/// The item to match.
/// Consider subcontainers.
/// The result of the operation.
public bool ContainsContainer(ReadOnlySpan container, bool useSubContainer = false)
{
var containerToCheck = useSubContainer && string.Equals(Container, "hls", StringComparison.OrdinalIgnoreCase) ? SubContainer : Container;
return ContainerHelper.ContainsContainer(containerToCheck, container);
}
}