1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-11 05:22:44 +01:00
Radarr/NzbDrone.Core/Jobs/XemUpdateJob.cs
Mark McDowall 5bbe310af5 Merge branch 'xem' into 'master'
Conflicts:
	NzbDrone.Common/DiskProvider.cs
	NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/ImportFileFixture.cs
	NzbDrone.Core/Providers/DecisionEngine/CustomStartDateSpecification.cs
	NzbDrone.Core/Providers/DiskScanProvider.cs
	NzbDrone.Core/Providers/DownloadProvider.cs
2012-10-20 16:07:04 -07:00

57 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using NLog;
using Ninject;
using NzbDrone.Core.Helpers;
using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Repository;
namespace NzbDrone.Core.Jobs
{
public class XemUpdateJob : IJob
{
private readonly XemProvider _xemProvider;
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
[Inject]
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);
_xemProvider.UpdateMappings(options.SeriesId);
}
_logger.Trace("XEM Update complete");
}
}
}