From e5a1b7a72e9a9764fea2631e773f5ae60aa15767 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 16 Jul 2023 21:25:14 +0300 Subject: [PATCH] Add missing seed criteria validation --- src/NzbDrone.Core/Indexers/Gazelle/GazelleSettings.cs | 2 ++ src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs | 2 ++ src/NzbDrone.Core/Indexers/Nyaa/NyaaSettings.cs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/NzbDrone.Core/Indexers/Gazelle/GazelleSettings.cs b/src/NzbDrone.Core/Indexers/Gazelle/GazelleSettings.cs index 4c56eb2f9..86dd9f1e2 100644 --- a/src/NzbDrone.Core/Indexers/Gazelle/GazelleSettings.cs +++ b/src/NzbDrone.Core/Indexers/Gazelle/GazelleSettings.cs @@ -11,6 +11,8 @@ namespace NzbDrone.Core.Indexers.Gazelle RuleFor(c => c.BaseUrl).ValidRootUrl(); RuleFor(c => c.Username).NotEmpty(); RuleFor(c => c.Password).NotEmpty(); + + RuleFor(c => c.SeedCriteria).SetValidator(_ => new SeedCriteriaSettingsValidator()); } } diff --git a/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs index 683fb211d..96ced8597 100644 --- a/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs +++ b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs @@ -17,6 +17,8 @@ namespace NzbDrone.Core.Indexers.IPTorrents RuleFor(c => c.BaseUrl).Matches(@"(?:/|t\.)rss\?.+;download(?:;|$)") .WithMessage("Use Direct Download Url (;download)") .When(v => v.BaseUrl.IsNotNullOrWhiteSpace() && Regex.IsMatch(v.BaseUrl, @"(?:/|t\.)rss\?.+$")); + + RuleFor(c => c.SeedCriteria).SetValidator(_ => new SeedCriteriaSettingsValidator()); } } diff --git a/src/NzbDrone.Core/Indexers/Nyaa/NyaaSettings.cs b/src/NzbDrone.Core/Indexers/Nyaa/NyaaSettings.cs index 27376532a..511285f49 100644 --- a/src/NzbDrone.Core/Indexers/Nyaa/NyaaSettings.cs +++ b/src/NzbDrone.Core/Indexers/Nyaa/NyaaSettings.cs @@ -10,6 +10,8 @@ namespace NzbDrone.Core.Indexers.Nyaa { RuleFor(c => c.BaseUrl).ValidRootUrl(); RuleFor(c => c.AdditionalParameters).Matches("(&[a-z]+=[a-z0-9_]+)*", RegexOptions.IgnoreCase); + + RuleFor(c => c.SeedCriteria).SetValidator(_ => new SeedCriteriaSettingsValidator()); } }