You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Radarr/src/NzbDrone.Core/CustomFormats/FormatTagMatchResult.cs

43 lines
1.1 KiB

using System.Collections.Generic;
using System.Linq;
namespace NzbDrone.Core.CustomFormats
{
public class FormatTagMatchResult
{
public FormatTagMatchResult()
{
GroupMatches = new List<FormatTagMatchesGroup>();
}
public CustomFormat CustomFormat { get; set; }
public List<FormatTagMatchesGroup> GroupMatches { get; set; }
public bool GoodMatch { get; set; }
}
public class FormatTagMatchesGroup
{
public FormatTagMatchesGroup()
{
Matches = new Dictionary<FormatTag, bool>();
}
public FormatTagMatchesGroup(TagType type, Dictionary<FormatTag, bool> matches)
{
Type = type;
Matches = matches;
}
public TagType Type { get; set; }
public bool DidMatch
{
get
{
return !(Matches.Any(m => m.Key.TagModifier.HasFlag(TagModifier.AbsolutelyRequired) && m.Value == false) ||
Matches.All(m => m.Value == false));
}
}
public Dictionary<FormatTag, bool> Matches { get; set; }
}
}