You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Radarr/NzbDrone.Core/SeriesStats/SeriesStatisticsService.cs

36 lines
1009 B

using System.Collections.Generic;
using System.Linq;
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;
}
}
}