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.
|
|
|
|
using NzbDrone.Core.Model.Notification;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Providers.Jobs
|
|
|
|
|
{
|
|
|
|
|
public class UpdateSceneMappingsJob : IJob
|
|
|
|
|
{
|
|
|
|
|
private readonly SceneMappingProvider _sceneNameMappingProvider;
|
|
|
|
|
|
|
|
|
|
public UpdateSceneMappingsJob(SceneMappingProvider sceneNameMappingProvider)
|
|
|
|
|
{
|
|
|
|
|
_sceneNameMappingProvider = sceneNameMappingProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UpdateSceneMappingsJob()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "Update Scene Mappings"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int DefaultInterval
|
|
|
|
|
{
|
|
|
|
|
get { return 720; } //Every 12 hours
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void Start(ProgressNotification notification, int targetId)
|
|
|
|
|
{
|
|
|
|
|
notification.CurrentMessage = "Updating Scene Mappings";
|
|
|
|
|
if (_sceneNameMappingProvider.UpdateMappings())
|
|
|
|
|
notification.CurrentMessage = "Scene Mappings Completed";
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
notification.CurrentMessage = "Scene Mappings Failed";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|