mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Check for valid URL in MetadataSource, Handle trailing slash
This commit is contained in:
parent
1396be4833
commit
75aa8af9d2
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue