1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2024-12-29 11:17:22 +00:00

core: API - "configured" parameter (#7120)

Add support for a "configured" parameter in the API 2.0. Only return configured indexers if true.
This commit is contained in:
Jonas Dellinger 2020-02-06 19:22:46 +01:00 committed by GitHub
parent 054e0e6440
commit 1715f0fda4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,9 +111,10 @@ namespace Jackett.Server.Controllers
[HttpGet]
[Route("")]
public IEnumerable<Common.Models.DTO.Indexer> Indexers()
public IEnumerable<Common.Models.DTO.Indexer> 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;
}