From 3ae1917d3b5f42411fdee1ff6c86113ab996d455 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 28 May 2023 14:37:25 +0300 Subject: [PATCH] Fixed: Revert seed criteria validation to warnings Closes #1692 --- .../Indexers/IndexerTorrentBaseSettings.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/IndexerTorrentBaseSettings.cs b/src/NzbDrone.Core/Indexers/IndexerTorrentBaseSettings.cs index d8001529d..bae3f889e 100644 --- a/src/NzbDrone.Core/Indexers/IndexerTorrentBaseSettings.cs +++ b/src/NzbDrone.Core/Indexers/IndexerTorrentBaseSettings.cs @@ -1,5 +1,6 @@ using FluentValidation; using NzbDrone.Core.Annotations; +using NzbDrone.Core.Validation; namespace NzbDrone.Core.Indexers { @@ -9,24 +10,25 @@ namespace NzbDrone.Core.Indexers { RuleFor(c => c.AppMinimumSeeders).GreaterThan(0) .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) .When(c => c.SeedRatio.HasValue) - .WithMessage("Should be greater than zero"); + .AsWarning().WithMessage("Should be greater than zero"); RuleFor(c => c.SeedTime).GreaterThan(0) .When(c => c.SeedTime.HasValue) - .WithMessage("Should be greater than zero"); + .AsWarning().WithMessage("Should be greater than zero"); RuleFor(c => c.PackSeedTime).GreaterThan(0) .When(c => c.PackSeedTime.HasValue) - .WithMessage("Should be greater than zero"); + .AsWarning().WithMessage("Should be greater than zero"); if (seedRatioMinimum != 0.0) { RuleFor(c => c.SeedRatio).GreaterThanOrEqualTo(seedRatioMinimum) .When(c => c.SeedRatio > 0.0) + .AsWarning() .WithMessage($"Under {seedRatioMinimum} leads to H&R"); } @@ -34,6 +36,7 @@ namespace NzbDrone.Core.Indexers { RuleFor(c => c.SeedTime).GreaterThanOrEqualTo(seedTimeMinimum) .When(c => c.SeedTime > 0) + .AsWarning() .WithMessage($"Under {seedTimeMinimum} leads to H&R"); } @@ -41,6 +44,7 @@ namespace NzbDrone.Core.Indexers { RuleFor(c => c.PackSeedTime).GreaterThanOrEqualTo(seasonPackSeedTimeMinimum) .When(c => c.PackSeedTime > 0) + .AsWarning() .WithMessage($"Under {seasonPackSeedTimeMinimum} leads to H&R"); } } @@ -48,8 +52,6 @@ namespace NzbDrone.Core.Indexers 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)] public int? AppMinimumSeeders { get; set; }