mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Added SeriesStatistics
This commit is contained in:
@@ -31,8 +31,20 @@ namespace NzbDrone.Api.Series
|
||||
private Response AllSeries()
|
||||
{
|
||||
var series = _seriesService.GetAllSeries().ToList();
|
||||
var seriesStats = _seriesService.SeriesStatistics();
|
||||
var seriesModels = Mapper.Map<List<Core.Tv.Series>, List<SeriesResource>>(series);
|
||||
|
||||
foreach (var s in seriesModels)
|
||||
{
|
||||
var stats = seriesStats.SingleOrDefault(ss => ss.SeriesId == s.Id);
|
||||
if (stats == null) continue;
|
||||
|
||||
s.EpisodeCount = stats.EpisodeCount;
|
||||
s.EpisodeFileCount = stats.EpisodeFileCount;
|
||||
s.NumberOfSeasons = stats.NumberOfSeasons;
|
||||
s.NextAiring = stats.NextAiring;
|
||||
}
|
||||
|
||||
return seriesModels.AsResponse();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user