mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-02-05 15:37:14 +00: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 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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user