mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -04:00
ffa1eee367
* Adds exception to allow metadataSource to be blank * Updates the exception to check for null or whitlespace to be more inclusive
26 lines
787 B
C#
26 lines
787 B
C#
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
|
|
{
|
|
public class MetadataProviderConfigModule : LidarrConfigModule<MetadataProviderConfigResource>
|
|
{
|
|
public MetadataProviderConfigModule(IConfigService configService)
|
|
: base(configService)
|
|
{
|
|
SharedValidator.RuleFor(c => c.MetadataSource).IsValidUrl().When(c => !c.MetadataSource.IsNullOrWhiteSpace());
|
|
}
|
|
|
|
protected override MetadataProviderConfigResource ToResource(IConfigService model)
|
|
{
|
|
return MetadataProviderConfigResourceMapper.ToResource(model);
|
|
}
|
|
}
|
|
}
|