2012-01-14 18:47:23 -08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
2011-12-01 17:33:17 -08:00
|
|
|
|
using NzbDrone.Core.Model.Notification;
|
|
|
|
|
using NzbDrone.Core.Providers;
|
2011-06-13 19:15:55 -07:00
|
|
|
|
|
2011-12-01 17:33:17 -08:00
|
|
|
|
namespace NzbDrone.Core.Jobs
|
2011-06-13 19:15:55 -07:00
|
|
|
|
{
|
2011-12-01 17:45:19 -08:00
|
|
|
|
public class UpdateSceneMappingsJob : IJob
|
2011-06-13 19:15:55 -07:00
|
|
|
|
{
|
2011-06-16 23:04:01 -07:00
|
|
|
|
private readonly SceneMappingProvider _sceneNameMappingProvider;
|
2011-06-13 19:15:55 -07:00
|
|
|
|
|
2011-06-16 23:04:01 -07:00
|
|
|
|
public UpdateSceneMappingsJob(SceneMappingProvider sceneNameMappingProvider)
|
2011-06-13 19:15:55 -07:00
|
|
|
|
{
|
|
|
|
|
_sceneNameMappingProvider = sceneNameMappingProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UpdateSceneMappingsJob()
|
|
|
|
|
{
|
2011-06-23 18:30:35 -07:00
|
|
|
|
|
2011-06-13 19:15:55 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "Update Scene Mappings"; }
|
|
|
|
|
}
|
|
|
|
|
|
2012-01-14 18:47:23 -08:00
|
|
|
|
public TimeSpan DefaultInterval
|
2011-06-13 19:15:55 -07:00
|
|
|
|
{
|
2012-01-14 18:47:23 -08:00
|
|
|
|
get { return TimeSpan.FromHours(12); }
|
2011-06-13 19:15:55 -07:00
|
|
|
|
}
|
|
|
|
|
|
2011-08-21 17:48:37 -07:00
|
|
|
|
public virtual void Start(ProgressNotification notification, int targetId, int secondaryTargetId)
|
2011-06-13 19:15:55 -07:00
|
|
|
|
{
|
2011-06-23 18:30:35 -07:00
|
|
|
|
_sceneNameMappingProvider.UpdateMappings();
|
2011-06-13 19:15:55 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|