mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
New: Auto tag based on artist's quality profile
(cherry picked from commit 6de3e7c950bd939bab96ef2ae74337108ad5a212)
This commit is contained in:
parent
26f80e37ec
commit
391fb10000
3 changed files with 40 additions and 1 deletions
|
@ -39,6 +39,8 @@ function getType({ type, selectOptionsProviderAction }) {
|
|||
return inputTypes.OAUTH;
|
||||
case 'rootFolder':
|
||||
return inputTypes.ROOT_FOLDER_SELECT;
|
||||
case 'qualityProfile':
|
||||
return inputTypes.QUALITY_PROFILE_SELECT;
|
||||
default:
|
||||
return inputTypes.TEXT;
|
||||
}
|
||||
|
|
|
@ -67,7 +67,8 @@ namespace NzbDrone.Core.Annotations
|
|||
Device,
|
||||
Playlist,
|
||||
TagSelect,
|
||||
RootFolder
|
||||
RootFolder,
|
||||
QualityProfile
|
||||
}
|
||||
|
||||
public enum HiddenType
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
using FluentValidation;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.AutoTagging.Specifications
|
||||
{
|
||||
public class QualityProfileSpecificationValidator : AbstractValidator<QualityProfileSpecification>
|
||||
{
|
||||
public QualityProfileSpecificationValidator()
|
||||
{
|
||||
RuleFor(c => c.Value).GreaterThan(0);
|
||||
}
|
||||
}
|
||||
|
||||
public class QualityProfileSpecification : AutoTaggingSpecificationBase
|
||||
{
|
||||
private static readonly QualityProfileSpecificationValidator Validator = new ();
|
||||
|
||||
public override int Order => 1;
|
||||
public override string ImplementationName => "Quality Profile";
|
||||
|
||||
[FieldDefinition(1, Label = "Quality Profile", Type = FieldType.QualityProfile)]
|
||||
public int Value { get; set; }
|
||||
|
||||
protected override bool IsSatisfiedByWithoutNegate(Artist artist)
|
||||
{
|
||||
return Value == artist.QualityProfileId;
|
||||
}
|
||||
|
||||
public override NzbDroneValidationResult Validate()
|
||||
{
|
||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue