mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Added SeriesStatistics
This commit is contained in:
parent
979efb8354
commit
f86cb87ced
8 changed files with 60 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue