Fixed: Revert seed criteria validation to warnings

Closes #1692
pull/1701/head
Bogdan 2 years ago
parent 5864a090e4
commit 3ae1917d3b

@ -1,5 +1,6 @@
using FluentValidation; using FluentValidation;
using NzbDrone.Core.Annotations; using NzbDrone.Core.Annotations;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers namespace NzbDrone.Core.Indexers
{ {
@ -9,24 +10,25 @@ namespace NzbDrone.Core.Indexers
{ {
RuleFor(c => c.AppMinimumSeeders).GreaterThan(0) RuleFor(c => c.AppMinimumSeeders).GreaterThan(0)
.When(c => c.AppMinimumSeeders.HasValue) .When(c => c.AppMinimumSeeders.HasValue)
.WithMessage("Should be greater than zero"); .AsWarning().WithMessage("Should be greater than zero");
RuleFor(c => c.SeedRatio).GreaterThan(0.0) RuleFor(c => c.SeedRatio).GreaterThan(0.0)
.When(c => c.SeedRatio.HasValue) .When(c => c.SeedRatio.HasValue)
.WithMessage("Should be greater than zero"); .AsWarning().WithMessage("Should be greater than zero");
RuleFor(c => c.SeedTime).GreaterThan(0) RuleFor(c => c.SeedTime).GreaterThan(0)
.When(c => c.SeedTime.HasValue) .When(c => c.SeedTime.HasValue)
.WithMessage("Should be greater than zero"); .AsWarning().WithMessage("Should be greater than zero");
RuleFor(c => c.PackSeedTime).GreaterThan(0) RuleFor(c => c.PackSeedTime).GreaterThan(0)
.When(c => c.PackSeedTime.HasValue) .When(c => c.PackSeedTime.HasValue)
.WithMessage("Should be greater than zero"); .AsWarning().WithMessage("Should be greater than zero");
if (seedRatioMinimum != 0.0) if (seedRatioMinimum != 0.0)
{ {
RuleFor(c => c.SeedRatio).GreaterThanOrEqualTo(seedRatioMinimum) RuleFor(c => c.SeedRatio).GreaterThanOrEqualTo(seedRatioMinimum)
.When(c => c.SeedRatio > 0.0) .When(c => c.SeedRatio > 0.0)
.AsWarning()
.WithMessage($"Under {seedRatioMinimum} leads to H&R"); .WithMessage($"Under {seedRatioMinimum} leads to H&R");
} }
@ -34,6 +36,7 @@ namespace NzbDrone.Core.Indexers
{ {
RuleFor(c => c.SeedTime).GreaterThanOrEqualTo(seedTimeMinimum) RuleFor(c => c.SeedTime).GreaterThanOrEqualTo(seedTimeMinimum)
.When(c => c.SeedTime > 0) .When(c => c.SeedTime > 0)
.AsWarning()
.WithMessage($"Under {seedTimeMinimum} leads to H&R"); .WithMessage($"Under {seedTimeMinimum} leads to H&R");
} }
@ -41,6 +44,7 @@ namespace NzbDrone.Core.Indexers
{ {
RuleFor(c => c.PackSeedTime).GreaterThanOrEqualTo(seasonPackSeedTimeMinimum) RuleFor(c => c.PackSeedTime).GreaterThanOrEqualTo(seasonPackSeedTimeMinimum)
.When(c => c.PackSeedTime > 0) .When(c => c.PackSeedTime > 0)
.AsWarning()
.WithMessage($"Under {seasonPackSeedTimeMinimum} leads to H&R"); .WithMessage($"Under {seasonPackSeedTimeMinimum} leads to H&R");
} }
} }
@ -48,8 +52,6 @@ namespace NzbDrone.Core.Indexers
public class IndexerTorrentBaseSettings public class IndexerTorrentBaseSettings
{ {
private static readonly IndexerTorrentSettingsValidator Validator = new ();
[FieldDefinition(1, Type = FieldType.Number, Label = "Apps Minimum Seeders", HelpText = "Minimum seeders required by the Applications for the indexer to grab, empty is Sync profile's default", Advanced = true)] [FieldDefinition(1, Type = FieldType.Number, Label = "Apps Minimum Seeders", HelpText = "Minimum seeders required by the Applications for the indexer to grab, empty is Sync profile's default", Advanced = true)]
public int? AppMinimumSeeders { get; set; } public int? AppMinimumSeeders { get; set; }

Loading…
Cancel
Save