|
|
|
@ -12,13 +12,21 @@ namespace NzbDrone.Core.Indexers
|
|
|
|
|
{
|
|
|
|
|
public SeedCriteriaSettingsValidator(double seedRatioMinimum = 0.0, int seedTimeMinimum = 0, int seasonPackSeedTimeMinimum = 0)
|
|
|
|
|
{
|
|
|
|
|
RuleFor(c => c.SeedRatio).GreaterThan(0.0).When(c => c.SeedRatio.HasValue).WithMessage("Must be greater than zero");
|
|
|
|
|
RuleFor(c => c.SeedTime).GreaterThan(0).When(c => c.SeedTime.HasValue).WithMessage("Must be greater than zero");
|
|
|
|
|
RuleFor(c => c.SeasonPackSeedTime).GreaterThan(0).When(c => c.SeasonPackSeedTime.HasValue).WithMessage("Must be greater than zero");
|
|
|
|
|
RuleFor(c => c.SeedRatio).GreaterThan(0.0)
|
|
|
|
|
.When(c => c.SeedRatio.HasValue)
|
|
|
|
|
.AsWarning().WithMessage("Should be greater than zero");
|
|
|
|
|
|
|
|
|
|
RuleFor(c => c.SeedTime).GreaterThan(0)
|
|
|
|
|
.When(c => c.SeedTime.HasValue)
|
|
|
|
|
.AsWarning().WithMessage("Should be greater than zero");
|
|
|
|
|
|
|
|
|
|
RuleFor(c => c.SeasonPackSeedTime).GreaterThan(0)
|
|
|
|
|
.When(c => c.SeasonPackSeedTime.HasValue)
|
|
|
|
|
.AsWarning().WithMessage("Should be greater than zero");
|
|
|
|
|
|
|
|
|
|
if (seedRatioMinimum != 0.0)
|
|
|
|
|
{
|
|
|
|
|
RuleFor(c => c.SeedRatio).GreaterThan(seedRatioMinimum)
|
|
|
|
|
RuleFor(c => c.SeedRatio).GreaterThanOrEqualTo(seedRatioMinimum)
|
|
|
|
|
.When(c => c.SeedRatio > 0.0)
|
|
|
|
|
.AsWarning()
|
|
|
|
|
.WithMessage($"Under {seedRatioMinimum} leads to H&R");
|
|
|
|
@ -26,7 +34,7 @@ namespace NzbDrone.Core.Indexers
|
|
|
|
|
|
|
|
|
|
if (seedTimeMinimum != 0)
|
|
|
|
|
{
|
|
|
|
|
RuleFor(c => c.SeedTime).GreaterThan(seedTimeMinimum)
|
|
|
|
|
RuleFor(c => c.SeedTime).GreaterThanOrEqualTo(seedTimeMinimum)
|
|
|
|
|
.When(c => c.SeedTime > 0)
|
|
|
|
|
.AsWarning()
|
|
|
|
|
.WithMessage($"Under {seedTimeMinimum} leads to H&R");
|
|
|
|
@ -34,7 +42,7 @@ namespace NzbDrone.Core.Indexers
|
|
|
|
|
|
|
|
|
|
if (seasonPackSeedTimeMinimum != 0)
|
|
|
|
|
{
|
|
|
|
|
RuleFor(c => c.SeasonPackSeedTime).GreaterThan(seasonPackSeedTimeMinimum)
|
|
|
|
|
RuleFor(c => c.SeasonPackSeedTime).GreaterThanOrEqualTo(seasonPackSeedTimeMinimum)
|
|
|
|
|
.When(c => c.SeasonPackSeedTime > 0)
|
|
|
|
|
.AsWarning()
|
|
|
|
|
.WithMessage($"Under {seasonPackSeedTimeMinimum} leads to H&R");
|
|
|
|
|