1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-11 13:32:42 +01:00
Radarr/NzbDrone.Core/Providers/Jobs/UpdateSceneMappingsJob.cs
Mark McDowall ab26d2dd61 Renamed SceneNameMapping to SceneMapping.
SceneMappingProvider moved to PetaPoco.
2011-06-16 23:04:01 -07:00

42 lines
1.1 KiB
C#

using System.Linq;
using System.Collections.Generic;
using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Repository;
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";
}
}
}