mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
Check for valid URL in MetadataSource, Handle trailing slash
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Linq;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
using Lidarr.Http;
|
using Lidarr.Http;
|
||||||
|
using NzbDrone.Core.Validation;
|
||||||
|
|
||||||
namespace Lidarr.Api.V3.Config
|
namespace Lidarr.Api.V3.Config
|
||||||
{
|
{
|
||||||
@@ -10,7 +11,7 @@ namespace Lidarr.Api.V3.Config
|
|||||||
public MetadataProviderConfigModule(IConfigService configService)
|
public MetadataProviderConfigModule(IConfigService configService)
|
||||||
: base(configService)
|
: base(configService)
|
||||||
{
|
{
|
||||||
|
SharedValidator.RuleFor(c => c.MetadataSource).IsValidUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override MetadataProviderConfigResource ToResource(IConfigService model)
|
protected override MetadataProviderConfigResource ToResource(IConfigService model)
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
|||||||
{
|
{
|
||||||
if (_configService.MetadataSource.IsNotNullOrWhiteSpace())
|
if (_configService.MetadataSource.IsNotNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
customerRequestBuilder = new HttpRequestBuilder(_configService.MetadataSource + "{route}/").CreateFactory();
|
customerRequestBuilder = new HttpRequestBuilder(_configService.MetadataSource.TrimEnd("/") + "/{route}/").CreateFactory();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user