sonarr-repo-only/NzbDrone.Core/DataAugmentation/DailySeries/DailySeriesService.cs

34 lines
885 B
C#
Raw Normal View History

2013-03-02 18:25:39 +00:00
using NzbDrone.Core.Tv;
2013-02-24 06:48:52 +00:00
2013-04-01 02:43:58 +00:00
namespace NzbDrone.Core.DataAugmentation.DailySeries
2013-02-24 06:48:52 +00:00
{
public class DailySeriesService
{
2013-05-07 00:39:33 +00:00
//TODO: add timer command
2013-03-02 18:25:39 +00:00
private readonly IDailySeriesDataProxy _proxy;
private readonly ISeriesService _seriesService;
2013-02-24 06:48:52 +00:00
2013-03-02 18:25:39 +00:00
public DailySeriesService(IDailySeriesDataProxy proxy, ISeriesService seriesService)
2013-02-24 06:48:52 +00:00
{
2013-03-02 18:25:39 +00:00
_proxy = proxy;
_seriesService = seriesService;
2013-02-24 06:48:52 +00:00
}
public virtual void UpdateDailySeries()
{
2013-03-02 18:25:39 +00:00
var dailySeries = _proxy.GetDailySeriesIds();
2013-02-24 06:48:52 +00:00
2013-03-02 18:25:39 +00:00
foreach (var tvdbId in dailySeries)
2013-02-24 06:48:52 +00:00
{
2013-03-02 18:25:39 +00:00
var series = _seriesService.FindByTvdbId(tvdbId);
2013-02-24 06:48:52 +00:00
2013-03-02 18:25:39 +00:00
if (series != null)
{
_seriesService.SetSeriesType(series.Id, SeriesTypes.Daily);
2013-03-02 18:25:39 +00:00
}
2013-02-24 06:48:52 +00:00
}
}
}
}