From 1715f0fda489afc97d0bb41f876681c08cb399a0 Mon Sep 17 00:00:00 2001 From: Jonas Dellinger Date: Thu, 6 Feb 2020 19:22:46 +0100 Subject: [PATCH] core: API - "configured" parameter (#7120) Add support for a "configured" parameter in the API 2.0. Only return configured indexers if true. --- src/Jackett.Server/Controllers/IndexerApiController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Jackett.Server/Controllers/IndexerApiController.cs b/src/Jackett.Server/Controllers/IndexerApiController.cs index 8e740266a..404c8d70a 100644 --- a/src/Jackett.Server/Controllers/IndexerApiController.cs +++ b/src/Jackett.Server/Controllers/IndexerApiController.cs @@ -111,9 +111,10 @@ namespace Jackett.Server.Controllers [HttpGet] [Route("")] - public IEnumerable Indexers() + public IEnumerable Indexers([FromQuery(Name = "configured")] bool configured) { var dto = IndexerService.GetAllIndexers().Select(i => new Common.Models.DTO.Indexer(i)); + dto = configured ? dto.Where(i => i.configured) : dto; return dto; }