From ffa1eee3671ff8c5f6120485e28e98799b70eefd Mon Sep 17 00:00:00 2001 From: David Bates Date: Wed, 1 Nov 2017 23:13:10 -0500 Subject: [PATCH] Adds exception to allow metadataSource to be blank (#115) * Adds exception to allow metadataSource to be blank * Updates the exception to check for null or whitlespace to be more inclusive --- src/Lidarr.Api.V1/Config/MetadataProviderConfigModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Lidarr.Api.V1/Config/MetadataProviderConfigModule.cs b/src/Lidarr.Api.V1/Config/MetadataProviderConfigModule.cs index 225e2746f..5286c87c5 100644 --- a/src/Lidarr.Api.V1/Config/MetadataProviderConfigModule.cs +++ b/src/Lidarr.Api.V1/Config/MetadataProviderConfigModule.cs @@ -1,7 +1,10 @@ +using System; using System.Linq; using System.Reflection; +using FluentValidation; using NzbDrone.Core.Configuration; using Lidarr.Http; +using NzbDrone.Common.Extensions; using NzbDrone.Core.Validation; namespace Lidarr.Api.V1.Config @@ -11,7 +14,7 @@ namespace Lidarr.Api.V1.Config public MetadataProviderConfigModule(IConfigService configService) : base(configService) { - SharedValidator.RuleFor(c => c.MetadataSource).IsValidUrl(); + SharedValidator.RuleFor(c => c.MetadataSource).IsValidUrl().When(c => !c.MetadataSource.IsNullOrWhiteSpace()); } protected override MetadataProviderConfigResource ToResource(IConfigService model)