Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Readarr/commit/2af33143ba369a1b586c17ba9ccef272f67fd36f
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
30 additions and
1 deletions
@ -0,0 +1,27 @@
using FluentValidation.Validators ;
using NzbDrone.Core.Download ;
namespace NzbDrone.Core.Validation
{
public class DownloadClientExistsValidator : PropertyValidator
{
private readonly IDownloadClientFactory _downloadClientFactory ;
public DownloadClientExistsValidator ( IDownloadClientFactory downloadClientFactory )
{
_downloadClientFactory = downloadClientFactory ;
}
protected override string GetDefaultMessageTemplate ( ) = > "Download Client does not exist" ;
protected override bool IsValid ( PropertyValidatorContext context )
{
if ( context ? . PropertyValue = = null | | ( int ) context . PropertyValue = = 0 )
{
return true ;
}
return _downloadClientFactory . Exists ( ( int ) context . PropertyValue ) ;
}
}
}
@ -1,4 +1,5 @@
using NzbDrone.Core.Indexers ;
using NzbDrone.Core.Validation ;
using Readarr.Http ;
namespace Readarr.Api.V1.Indexers
@ -9,9 +10,10 @@ namespace Readarr.Api.V1.Indexers
public static readonly IndexerResourceMapper ResourceMapper = new ( ) ;
public static readonly IndexerBulkResourceMapper BulkResourceMapper = new ( ) ;
public IndexerController ( IndexerFactory indexerFactory )
public IndexerController ( IndexerFactory indexerFactory , DownloadClientExistsValidator downloadClientExistsValidator )
: base ( indexerFactory , "indexer" , ResourceMapper , BulkResourceMapper )
{
SharedValidator . RuleFor ( c = > c . DownloadClientId ) . SetValidator ( downloadClientExistsValidator ) ;
}
}
}