New: Updated FluentValidation to 8.4.0

Co-Authored-By: taloth <taloth@users.noreply.github.com>
This commit is contained in:
Qstick 2019-09-11 21:26:54 -04:00
parent 22fb4a1801
commit 40483c1bbb
11 changed files with 19 additions and 46 deletions

View file

@ -32,14 +32,12 @@ namespace Lidarr.Api.V1.Profiles.Delay
SharedValidator.RuleFor(d => d.UsenetDelay).GreaterThanOrEqualTo(0);
SharedValidator.RuleFor(d => d.TorrentDelay).GreaterThanOrEqualTo(0);
SharedValidator.Custom(delayProfile =>
SharedValidator.RuleFor(d => d).Custom((delayProfile, context) =>
{
if (!delayProfile.EnableUsenet && !delayProfile.EnableTorrent)
{
return new ValidationFailure("", "Either Usenet or Torrent should be enabled");
context.AddFailure("Either Usenet or Torrent should be enabled");
}
return null;
});
}