diff --git a/src/NzbDrone.Core/Backup/BackupCommand.cs b/src/NzbDrone.Core/Backup/BackupCommand.cs index 29199c67a..72fd2ddcc 100644 --- a/src/NzbDrone.Core/Backup/BackupCommand.cs +++ b/src/NzbDrone.Core/Backup/BackupCommand.cs @@ -13,11 +13,19 @@ public override bool SendUpdatesToClient return true; } } + + public override bool UpdateScheduledTask + { + get + { + return Type == BackupType.Scheduled; + } + } } public enum BackupType { - Scheduled = 0 , + Scheduled = 0, Manual = 1, Update = 2 } diff --git a/src/NzbDrone.Core/Jobs/TaskManager.cs b/src/NzbDrone.Core/Jobs/TaskManager.cs index c820164fe..0a7d71870 100644 --- a/src/NzbDrone.Core/Jobs/TaskManager.cs +++ b/src/NzbDrone.Core/Jobs/TaskManager.cs @@ -127,7 +127,7 @@ public void Handle(CommandExecutedEvent message) { var scheduledTask = _scheduledTaskRepository.All().SingleOrDefault(c => c.TypeName == message.Command.Body.GetType().FullName); - if (scheduledTask != null) + if (scheduledTask != null && message.Command.Body.UpdateScheduledTask) { _logger.Trace("Updating last run time for: {0}", scheduledTask.TypeName); _scheduledTaskRepository.SetLastExecutionTime(scheduledTask.Id, DateTime.UtcNow); diff --git a/src/NzbDrone.Core/Messaging/Commands/Command.cs b/src/NzbDrone.Core/Messaging/Commands/Command.cs index 36dc1adcd..e68a9f6d5 100644 --- a/src/NzbDrone.Core/Messaging/Commands/Command.cs +++ b/src/NzbDrone.Core/Messaging/Commands/Command.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Messaging.Commands { public abstract class Command { - public virtual Boolean SendUpdatesToClient + public virtual bool SendUpdatesToClient { get { @@ -12,6 +12,14 @@ public virtual Boolean SendUpdatesToClient } } + public virtual bool UpdateScheduledTask + { + get + { + return true; + } + } + public virtual string CompletionMessage { get diff --git a/src/NzbDrone.Core/Tv/Commands/RefreshSeriesCommand.cs b/src/NzbDrone.Core/Tv/Commands/RefreshSeriesCommand.cs index 8ccc3a2b4..fbe346a26 100644 --- a/src/NzbDrone.Core/Tv/Commands/RefreshSeriesCommand.cs +++ b/src/NzbDrone.Core/Tv/Commands/RefreshSeriesCommand.cs @@ -22,5 +22,13 @@ public override bool SendUpdatesToClient return true; } } + + public override bool UpdateScheduledTask + { + get + { + return !SeriesId.HasValue; + } + } } } \ No newline at end of file