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.
32 lines
823 B
32 lines
823 B
using FluentValidation;
|
|
|
|
namespace TrashLib.Sonarr.ReleaseProfile;
|
|
|
|
internal class TermDataValidator : AbstractValidator<TermData>
|
|
{
|
|
public TermDataValidator()
|
|
{
|
|
RuleFor(x => x.Term).NotEmpty();
|
|
}
|
|
}
|
|
|
|
internal class PreferredTermDataValidator : AbstractValidator<PreferredTermData>
|
|
{
|
|
public PreferredTermDataValidator()
|
|
{
|
|
RuleFor(x => x.Terms).NotEmpty();
|
|
}
|
|
}
|
|
|
|
internal class ReleaseProfileDataValidator : AbstractValidator<ReleaseProfileData>
|
|
{
|
|
public ReleaseProfileDataValidator()
|
|
{
|
|
RuleFor(x => x.Name).NotEmpty();
|
|
RuleFor(x => x.TrashId).NotEmpty();
|
|
RuleFor(x => x)
|
|
.Must(x => x.Required.Any() || x.Ignored.Any() || x.Preferred.Any())
|
|
.WithMessage("Must have at least one of Required, Ignored, or Preferred terms");
|
|
}
|
|
}
|