Add missing seed criteria validation

pull/2680/head
Bogdan 2 years ago
parent 2f2a521391
commit e5a1b7a72e

@ -11,6 +11,8 @@ namespace NzbDrone.Core.Indexers.Gazelle
RuleFor(c => c.BaseUrl).ValidRootUrl(); RuleFor(c => c.BaseUrl).ValidRootUrl();
RuleFor(c => c.Username).NotEmpty(); RuleFor(c => c.Username).NotEmpty();
RuleFor(c => c.Password).NotEmpty(); RuleFor(c => c.Password).NotEmpty();
RuleFor(c => c.SeedCriteria).SetValidator(_ => new SeedCriteriaSettingsValidator());
} }
} }

@ -17,6 +17,8 @@ namespace NzbDrone.Core.Indexers.IPTorrents
RuleFor(c => c.BaseUrl).Matches(@"(?:/|t\.)rss\?.+;download(?:;|$)") RuleFor(c => c.BaseUrl).Matches(@"(?:/|t\.)rss\?.+;download(?:;|$)")
.WithMessage("Use Direct Download Url (;download)") .WithMessage("Use Direct Download Url (;download)")
.When(v => v.BaseUrl.IsNotNullOrWhiteSpace() && Regex.IsMatch(v.BaseUrl, @"(?:/|t\.)rss\?.+$")); .When(v => v.BaseUrl.IsNotNullOrWhiteSpace() && Regex.IsMatch(v.BaseUrl, @"(?:/|t\.)rss\?.+$"));
RuleFor(c => c.SeedCriteria).SetValidator(_ => new SeedCriteriaSettingsValidator());
} }
} }

@ -10,6 +10,8 @@ namespace NzbDrone.Core.Indexers.Nyaa
{ {
RuleFor(c => c.BaseUrl).ValidRootUrl(); RuleFor(c => c.BaseUrl).ValidRootUrl();
RuleFor(c => c.AdditionalParameters).Matches("(&[a-z]+=[a-z0-9_]+)*", RegexOptions.IgnoreCase); RuleFor(c => c.AdditionalParameters).Matches("(&[a-z]+=[a-z0-9_]+)*", RegexOptions.IgnoreCase);
RuleFor(c => c.SeedCriteria).SetValidator(_ => new SeedCriteriaSettingsValidator());
} }
} }

Loading…
Cancel
Save