mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
Added job for updating XEM mappings
XEM mappings will also be updated when a new series is imported
This commit is contained in:
parent
7b5d57d224
commit
5cd9438939
4 changed files with 109 additions and 32 deletions
52
NzbDrone.Core/Jobs/XemUpdateJob.cs
Normal file
52
NzbDrone.Core/Jobs/XemUpdateJob.cs
Normal file
|
@ -0,0 +1,52 @@
|
|||
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, int targetId, int secondaryTargetId)
|
||||
{
|
||||
if (targetId == 0)
|
||||
{
|
||||
_logger.Trace("Starting XEM Update for all series");
|
||||
_xemProvider.UpdateMappings();
|
||||
}
|
||||
_logger.Trace("Starting XEM Update for series: {0}", targetId);
|
||||
_xemProvider.UpdateMappings(targetId);
|
||||
_logger.Trace("XEM Update complete");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue