1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-12 22:12:38 +01:00
Radarr/NzbDrone.Core/Jobs/Implementations/XemUpdateJob.cs

52 lines
1.3 KiB
C#
Raw Normal View History

2013-03-05 06:37:33 +01:00
using System;
using System.Linq;
using NLog;
using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers;
2013-03-05 06:37:33 +01:00
namespace NzbDrone.Core.Jobs.Implementations
{
public class XemUpdateJob : IJob
{
private readonly XemProvider _xemProvider;
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
public XemUpdateJob(XemProvider xemProvider)
{
_xemProvider = xemProvider;
}
public XemUpdateJob()
{
}
public string Name
{
get { return "XEM Update"; }
}
public TimeSpan DefaultInterval
{
get { return TimeSpan.FromHours(12); }
}
public virtual void Start(ProgressNotification notification, dynamic options)
{
if (options == null || options.SeriesId == 0)
{
_logger.Trace("Starting XEM Update for all series");
_xemProvider.UpdateMappings();
}
else
{
_logger.Trace("Starting XEM Update for series: {0}", options.SeriesId);
2013-02-23 00:55:43 +01:00
_xemProvider.UpdateMappings((int)options.SeriesId);
}
2013-02-23 00:55:43 +01:00
_logger.Trace("XEM Update complete");
}
}
}