mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 12:32:31 +01:00
35 lines
990 B
C#
35 lines
990 B
C#
using System.Collections.Generic;
|
|
|
|
namespace NzbDrone.Core.SeriesStats
|
|
{
|
|
public interface ISeriesStatisticsService
|
|
{
|
|
List<SeriesStatistics> SeriesStatistics();
|
|
SeriesStatistics SeriesStatistics(int seriesId);
|
|
}
|
|
|
|
public class SeriesStatisticsService : ISeriesStatisticsService
|
|
{
|
|
private readonly SeriesStatisticsRepository _seriesStatisticsRepository;
|
|
|
|
public SeriesStatisticsService(SeriesStatisticsRepository seriesStatisticsRepository)
|
|
{
|
|
_seriesStatisticsRepository = seriesStatisticsRepository;
|
|
}
|
|
|
|
public List<SeriesStatistics> SeriesStatistics()
|
|
{
|
|
return _seriesStatisticsRepository.SeriesStatistics();
|
|
}
|
|
|
|
public SeriesStatistics SeriesStatistics(int seriesId)
|
|
{
|
|
var stats = _seriesStatisticsRepository.SeriesStatistics(seriesId);
|
|
|
|
if (stats == null) return new SeriesStatistics();
|
|
|
|
return stats;
|
|
}
|
|
}
|
|
}
|