mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-26 07:42:49 +00: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.Reflection;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using Lidarr.Http;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace Lidarr.Api.V3.Config
|
||||
{
|
||||
|
@ -10,7 +11,7 @@ public class MetadataProviderConfigModule : SonarrConfigModule<MetadataProviderC
|
|||
public MetadataProviderConfigModule(IConfigService configService)
|
||||
: base(configService)
|
||||
{
|
||||
|
||||
SharedValidator.RuleFor(c => c.MetadataSource).IsValidUrl();
|
||||
}
|
||||
|
||||
protected override MetadataProviderConfigResource ToResource(IConfigService model)
|
||||
|
|
|
@ -287,7 +287,7 @@ private void SetCustomProvider()
|
|||
{
|
||||
if (_configService.MetadataSource.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
customerRequestBuilder = new HttpRequestBuilder(_configService.MetadataSource + "{route}/").CreateFactory();
|
||||
customerRequestBuilder = new HttpRequestBuilder(_configService.MetadataSource.TrimEnd("/") + "/{route}/").CreateFactory();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue