sonarr-repo-only/NzbDrone.Core/SeriesStats/SeriesStatisticsService.cs

36 lines
1009 B
C#
Raw Normal View History

2013-04-20 23:36:23 +00:00
using System.Collections.Generic;
using System.Linq;
2013-04-20 23:36:23 +00:00
namespace NzbDrone.Core.SeriesStats
{
public interface ISeriesStatisticsService
{
List<SeriesStatistics> SeriesStatistics();
SeriesStatistics SeriesStatistics(int seriesId);
2013-04-20 23:36:23 +00:00
}
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;
}
2013-04-20 23:36:23 +00:00
}
}