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.
37 lines
1.1 KiB
37 lines
1.1 KiB
using FluentValidation;
|
|
using NzbDrone.Core.Annotations;
|
|
using NzbDrone.Core.Music;
|
|
using NzbDrone.Core.Validation;
|
|
|
|
namespace NzbDrone.Core.AutoTagging.Specifications
|
|
{
|
|
public class MetadataProfileSpecificationValidator : AbstractValidator<MetadataProfileSpecification>
|
|
{
|
|
public MetadataProfileSpecificationValidator()
|
|
{
|
|
RuleFor(c => c.Value).GreaterThan(0);
|
|
}
|
|
}
|
|
|
|
public class MetadataProfileSpecification : AutoTaggingSpecificationBase
|
|
{
|
|
private static readonly MetadataProfileSpecificationValidator Validator = new ();
|
|
|
|
public override int Order => 1;
|
|
public override string ImplementationName => "Metadata Profile";
|
|
|
|
[FieldDefinition(1, Label = "Metadata Profile", Type = FieldType.MetadataProfile)]
|
|
public int Value { get; set; }
|
|
|
|
protected override bool IsSatisfiedByWithoutNegate(Artist artist)
|
|
{
|
|
return Value == artist.MetadataProfileId;
|
|
}
|
|
|
|
public override NzbDroneValidationResult Validate()
|
|
{
|
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
|
}
|
|
}
|
|
}
|