You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prowlarr/src/Prowlarr.Api.V1/Indexers/IndexerController.cs

26 lines
995 B

using FluentValidation;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Validation;
using Prowlarr.Http;
namespace Prowlarr.Api.V1.Indexers
{
[V1ApiController]
public class IndexerController : ProviderControllerBase<IndexerResource, IndexerBulkResource, IIndexer, IndexerDefinition>
{
public IndexerController(IndexerFactory indexerFactory,
IndexerResourceMapper resourceMapper,
IndexerBulkResourceMapper bulkResourceMapper,
AppProfileExistsValidator appProfileExistsValidator,
DownloadClientExistsValidator downloadClientExistsValidator)
: base(indexerFactory, "indexer", resourceMapper, bulkResourceMapper)
{
SharedValidator.RuleFor(c => c.AppProfileId).Cascade(CascadeMode.Stop)
.ValidId()
.SetValidator(appProfileExistsValidator);
SharedValidator.RuleFor(c => c.DownloadClientId).SetValidator(downloadClientExistsValidator);
}
}
}