Check for valid URL in MetadataSource, Handle trailing slash

pull/110/head
Qstick 7 years ago
parent 1396be4833
commit 75aa8af9d2

@ -2,6 +2,7 @@ using System.Linq;
using System.Reflection;
using NzbDrone.Core.Configuration;
using Lidarr.Http;
using NzbDrone.Core.Validation;
namespace Lidarr.Api.V3.Config
{
@ -10,7 +11,7 @@ namespace Lidarr.Api.V3.Config
public MetadataProviderConfigModule(IConfigService configService)
: base(configService)
{
SharedValidator.RuleFor(c => c.MetadataSource).IsValidUrl();
}
protected override MetadataProviderConfigResource ToResource(IConfigService model)

@ -287,7 +287,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
{
if (_configService.MetadataSource.IsNotNullOrWhiteSpace())
{
customerRequestBuilder = new HttpRequestBuilder(_configService.MetadataSource + "{route}/").CreateFactory();
customerRequestBuilder = new HttpRequestBuilder(_configService.MetadataSource.TrimEnd("/") + "/{route}/").CreateFactory();
}
else
{

Loading…
Cancel
Save