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.
33 lines
857 B
33 lines
857 B
using System.Linq;
|
|
using NzbDrone.Core.Tv;
|
|
|
|
namespace NzbDrone.Core.ReferenceData
|
|
{
|
|
public class DailySeriesService
|
|
{
|
|
private readonly IDailySeriesDataProxy _proxy;
|
|
private readonly ISeriesService _seriesService;
|
|
|
|
public DailySeriesService(IDailySeriesDataProxy proxy, ISeriesService seriesService)
|
|
{
|
|
_proxy = proxy;
|
|
_seriesService = seriesService;
|
|
}
|
|
|
|
public virtual void UpdateDailySeries()
|
|
{
|
|
var dailySeries = _proxy.GetDailySeriesIds();
|
|
|
|
foreach (var tvdbId in dailySeries)
|
|
{
|
|
var series = _seriesService.FindByTvdbId(tvdbId);
|
|
|
|
if (series != null)
|
|
{
|
|
_seriesService.SetSeriesType(series.Id, SeriesTypes.Daily);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|