mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 08:07:10 -07:00
New: Auto tag based on artist status
(cherry picked from commit 7be22af865c51a9f9f8bb659e223d3c1a0accd3f)
This commit is contained in:
parent
391fb10000
commit
ef9473e96e
1 changed files with 32 additions and 0 deletions
|
@ -0,0 +1,32 @@
|
||||||
|
using FluentValidation;
|
||||||
|
using NzbDrone.Core.Annotations;
|
||||||
|
using NzbDrone.Core.Music;
|
||||||
|
using NzbDrone.Core.Validation;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.AutoTagging.Specifications
|
||||||
|
{
|
||||||
|
public class StatusSpecificationValidator : AbstractValidator<StatusSpecification>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class StatusSpecification : AutoTaggingSpecificationBase
|
||||||
|
{
|
||||||
|
private static readonly StatusSpecificationValidator Validator = new ();
|
||||||
|
|
||||||
|
public override int Order => 1;
|
||||||
|
public override string ImplementationName => "Status";
|
||||||
|
|
||||||
|
[FieldDefinition(1, Label = "Status", Type = FieldType.Select, SelectOptions = typeof(ArtistStatusType))]
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
protected override bool IsSatisfiedByWithoutNegate(Artist artist)
|
||||||
|
{
|
||||||
|
return artist?.Metadata?.Value?.Status == (ArtistStatusType)Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override NzbDroneValidationResult Validate()
|
||||||
|
{
|
||||||
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue