mirror of
https://github.com/Radarr/Radarr.git
synced 2024-07-07 04:19:25 +02:00
New: Auto tag based on movie's quality profile
(cherry picked from commit 6de3e7c950bd939bab96ef2ae74337108ad5a212) Closes #9254
This commit is contained in:
parent
f13d479b88
commit
99f7d8bcf5
@ -37,6 +37,8 @@ function getType({ type, selectOptionsProviderAction }) {
|
|||||||
return inputTypes.OAUTH;
|
return inputTypes.OAUTH;
|
||||||
case 'rootFolder':
|
case 'rootFolder':
|
||||||
return inputTypes.ROOT_FOLDER_SELECT;
|
return inputTypes.ROOT_FOLDER_SELECT;
|
||||||
|
case 'qualityProfile':
|
||||||
|
return inputTypes.QUALITY_PROFILE_SELECT;
|
||||||
default:
|
default:
|
||||||
return inputTypes.TEXT;
|
return inputTypes.TEXT;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,8 @@ public enum FieldType
|
|||||||
OAuth,
|
OAuth,
|
||||||
Device,
|
Device,
|
||||||
TagSelect,
|
TagSelect,
|
||||||
RootFolder
|
RootFolder,
|
||||||
|
QualityProfile
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum HiddenType
|
public enum HiddenType
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
using FluentValidation;
|
||||||
|
using NzbDrone.Core.Annotations;
|
||||||
|
using NzbDrone.Core.Movies;
|
||||||
|
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(Movie movie)
|
||||||
|
{
|
||||||
|
return Value == movie.QualityProfileId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override NzbDroneValidationResult Validate()
|
||||||
|
{
|
||||||
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user