mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
New: Auto tag based on artist's metadata profile
This commit is contained in:
parent
ef9473e96e
commit
eeb5e9b30f
3 changed files with 40 additions and 1 deletions
|
@ -41,6 +41,8 @@ function getType({ type, selectOptionsProviderAction }) {
|
||||||
return inputTypes.ROOT_FOLDER_SELECT;
|
return inputTypes.ROOT_FOLDER_SELECT;
|
||||||
case 'qualityProfile':
|
case 'qualityProfile':
|
||||||
return inputTypes.QUALITY_PROFILE_SELECT;
|
return inputTypes.QUALITY_PROFILE_SELECT;
|
||||||
|
case 'metadataProfile':
|
||||||
|
return inputTypes.METADATA_PROFILE_SELECT;
|
||||||
default:
|
default:
|
||||||
return inputTypes.TEXT;
|
return inputTypes.TEXT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,8 @@ namespace NzbDrone.Core.Annotations
|
||||||
Playlist,
|
Playlist,
|
||||||
TagSelect,
|
TagSelect,
|
||||||
RootFolder,
|
RootFolder,
|
||||||
QualityProfile
|
QualityProfile,
|
||||||
|
MetadataProfile
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum HiddenType
|
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 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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue