2013-04-21 01:36:23 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.SeriesStats
|
|
|
|
|
{
|
|
|
|
|
public interface ISeriesStatisticsService
|
|
|
|
|
{
|
|
|
|
|
List<SeriesStatistics> SeriesStatistics();
|
2013-07-18 02:07:48 +02:00
|
|
|
|
SeriesStatistics SeriesStatistics(int seriesId);
|
2013-04-21 01:36:23 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class SeriesStatisticsService : ISeriesStatisticsService
|
|
|
|
|
{
|
|
|
|
|
private readonly SeriesStatisticsRepository _seriesStatisticsRepository;
|
|
|
|
|
|
|
|
|
|
public SeriesStatisticsService(SeriesStatisticsRepository seriesStatisticsRepository)
|
|
|
|
|
{
|
|
|
|
|
_seriesStatisticsRepository = seriesStatisticsRepository;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<SeriesStatistics> SeriesStatistics()
|
|
|
|
|
{
|
|
|
|
|
return _seriesStatisticsRepository.SeriesStatistics();
|
|
|
|
|
}
|
2013-07-18 02:07:48 +02:00
|
|
|
|
|
|
|
|
|
public SeriesStatistics SeriesStatistics(int seriesId)
|
|
|
|
|
{
|
|
|
|
|
var stats = _seriesStatisticsRepository.SeriesStatistics(seriesId);
|
|
|
|
|
|
|
|
|
|
if (stats == null) return new SeriesStatistics();
|
|
|
|
|
|
|
|
|
|
return stats;
|
|
|
|
|
}
|
2013-04-21 01:36:23 +02:00
|
|
|
|
}
|
|
|
|
|
}
|