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.
Lidarr/src/NzbDrone.Core/AutoTagging/Specifications/AutoTagSpecificationBase.cs

37 lines
953 B

using NzbDrone.Core.Music;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.AutoTagging.Specifications
{
public abstract class AutoTaggingSpecificationBase : IAutoTaggingSpecification
{
public abstract int Order { get; }
public abstract string ImplementationName { get; }
public string Name { get; set; }
public bool Negate { get; set; }
public bool Required { get; set; }
public IAutoTaggingSpecification Clone()
{
return (IAutoTaggingSpecification)MemberwiseClone();
}
public abstract NzbDroneValidationResult Validate();
public bool IsSatisfiedBy(Artist artist)
{
var match = IsSatisfiedByWithoutNegate(artist);
if (Negate)
{
match = !match;
}
return match;
}
protected abstract bool IsSatisfiedByWithoutNegate(Artist artist);
}
}