mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Basic Indexer Statistics Endpoint
This commit is contained in:
27
src/Prowlarr.Api.V1/Indexers/IndexerStatsModule.cs
Normal file
27
src/Prowlarr.Api.V1/Indexers/IndexerStatsModule.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user