Added missing UrlBase validation for SabnzbdSettings.

This commit is contained in:
Taloth Saldono 2018-07-18 07:39:58 +02:00
parent 2a1421f488
commit fc44607c73
1 changed files with 2 additions and 0 deletions

View File

@ -1,4 +1,5 @@
using FluentValidation; using FluentValidation;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Annotations; using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider; using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation; using NzbDrone.Core.Validation;
@ -11,6 +12,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
{ {
RuleFor(c => c.Host).ValidHost(); RuleFor(c => c.Host).ValidHost();
RuleFor(c => c.Port).InclusiveBetween(1, 65535); RuleFor(c => c.Port).InclusiveBetween(1, 65535);
RuleFor(c => c.UrlBase).ValidUrlBase().When(c => c.UrlBase.IsNotNullOrWhiteSpace());
RuleFor(c => c.ApiKey).NotEmpty() RuleFor(c => c.ApiKey).NotEmpty()
.WithMessage("API Key is required when username/password are not configured") .WithMessage("API Key is required when username/password are not configured")