Basic Indexer Statistics Endpoint

This commit is contained in:
Qstick
2020-11-16 13:12:20 -05:00
parent fef81171ba
commit 5b22093c29
18 changed files with 159 additions and 39 deletions

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NzbDrone.Core.IndexerStats;
using Prowlarr.Http;
namespace Prowlarr.Api.V1.Indexers
{
public class IndexerStatsModule : ProwlarrRestModule<IndexerStatsResource>
{
private readonly IIndexerStatisticsService _indexerStatisticsService;
public IndexerStatsModule(IIndexerStatisticsService indexerStatisticsService)
{
_indexerStatisticsService = indexerStatisticsService;
GetResourceAll = GetAll;
}
private List<IndexerStatsResource> GetAll()
{
return _indexerStatisticsService.IndexerStatistics().ToResource();
}
}
}