1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-03-05 15:15:59 +02:00

45 lines
1.1 KiB
C#
Raw Normal View History

2013-03-02 10:25:39 -08:00
using NzbDrone.Core.Tv;
2013-02-23 22:48:52 -08:00
2013-03-31 19:43:58 -07:00
namespace NzbDrone.Core.DataAugmentation.DailySeries
2013-02-23 22:48:52 -08:00
{
public interface IDailySeriesService
{
void UpdateDailySeries();
bool IsDailySeries(int tvdbid);
}
public class DailySeriesService : IDailySeriesService
2013-02-23 22:48:52 -08:00
{
2013-05-06 17:39:33 -07:00
//TODO: add timer command
2013-03-02 10:25:39 -08:00
private readonly IDailySeriesDataProxy _proxy;
private readonly ISeriesService _seriesService;
2013-02-23 22:48:52 -08:00
2013-03-02 10:25:39 -08:00
public DailySeriesService(IDailySeriesDataProxy proxy, ISeriesService seriesService)
2013-02-23 22:48:52 -08:00
{
2013-03-02 10:25:39 -08:00
_proxy = proxy;
_seriesService = seriesService;
2013-02-23 22:48:52 -08:00
}
public void UpdateDailySeries()
2013-02-23 22:48:52 -08:00
{
2013-03-02 10:25:39 -08:00
var dailySeries = _proxy.GetDailySeriesIds();
2013-02-23 22:48:52 -08:00
2013-03-02 10:25:39 -08:00
foreach (var tvdbId in dailySeries)
2013-02-23 22:48:52 -08:00
{
2013-03-02 10:25:39 -08:00
var series = _seriesService.FindByTvdbId(tvdbId);
2013-02-23 22:48:52 -08:00
2013-03-02 10:25:39 -08:00
if (series != null)
{
_seriesService.SetSeriesType(series.Id, SeriesTypes.Daily);
2013-03-02 10:25:39 -08:00
}
2013-02-23 22:48:52 -08:00
}
}
public bool IsDailySeries(int tvdbid)
{
return _proxy.IsDailySeries(tvdbid);
}
2013-02-23 22:48:52 -08:00
}
}