diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs index 514bcbee8..13f7e3d77 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs @@ -355,6 +355,7 @@ protected override void Test(List failures) { failures.AddIfNotNull(TestConnection()); failures.AddIfNotNull(TestAuthentication()); + failures.AddIfNotNull(TestGlobalConfig()); failures.AddIfNotNull(TestCategory()); if (!Settings.TvCategoryLocalPath.IsNullOrWhiteSpace()) @@ -399,10 +400,25 @@ private ValidationFailure TestAuthentication() return null; } + + private ValidationFailure TestGlobalConfig() + { + var config = _proxy.GetConfig(Settings); + if (config.Misc.pre_check) + { + return new NzbDroneValidationFailure("", "Disable 'Check before download' option in Sabnbzd") + { + InfoLink = String.Format("http://{0}:{1}/sabnzbd/config/switches/", Settings.Host, Settings.Port), + DetailedDescription = "Using Check before download affects NzbDrone ability to track new downloads. Also Sabnzbd recommends 'Abort jobs that cannot be completed' instead since it's more effective." + }; + } + + return null; + } private ValidationFailure TestCategory() { - var config = this._proxy.GetConfig(Settings); + var config = _proxy.GetConfig(Settings); var category = GetCategories(config).FirstOrDefault((SabnzbdCategory v) => v.Name == Settings.TvCategory); if (category != null) diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdCategory.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdCategory.cs index 15913c620..2068cd0a8 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdCategory.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdCategory.cs @@ -19,6 +19,7 @@ public class SabnzbdConfigMisc public String complete_dir { get; set; } public String[] tv_categories { get; set; } public Boolean enable_tv_sorting { get; set; } + public Boolean pre_check { get; set; } } public class SabnzbdCategory diff --git a/src/NzbDrone.Core/Download/DownloadTrackingService.cs b/src/NzbDrone.Core/Download/DownloadTrackingService.cs index 3dc255219..37ad08d4b 100644 --- a/src/NzbDrone.Core/Download/DownloadTrackingService.cs +++ b/src/NzbDrone.Core/Download/DownloadTrackingService.cs @@ -147,7 +147,7 @@ private Boolean UpdateTrackedDownloads() State = TrackedDownloadState.Unknown }; - _logger.Debug("Started tracking download from history: {0}: {1}", trackedDownload.TrackingId, downloadItem.Title); + _logger.Debug("[{0}] Started tracking download with id {1}.", downloadItem.Title, trackingId); stateChanged = true; } @@ -157,17 +157,17 @@ private Boolean UpdateTrackedDownloads() } } - foreach (var downloadItem in oldTrackedDownloads.Values.Where(v => !newTrackedDownloads.ContainsKey(v.TrackingId))) + foreach (var trackedDownload in oldTrackedDownloads.Values.Where(v => !newTrackedDownloads.ContainsKey(v.TrackingId))) { - if (downloadItem.State != TrackedDownloadState.Removed) + if (trackedDownload.State != TrackedDownloadState.Removed) { - downloadItem.State = TrackedDownloadState.Removed; + trackedDownload.State = TrackedDownloadState.Removed; stateChanged = true; - _logger.Debug("Item removed from download client by user: {0}: {1}", downloadItem.TrackingId, downloadItem.DownloadItem.Title); + _logger.Debug("[{0}] Item with id {1} removed from download client directly (possibly by user).", trackedDownload.DownloadItem.Title, trackedDownload.TrackingId); } - _logger.Debug("Stopped tracking download: {0}: {1}", downloadItem.TrackingId, downloadItem.DownloadItem.Title); + _logger.Debug("[{0}] Stopped tracking download with id {1}.", trackedDownload.DownloadItem.Title, trackedDownload.TrackingId); } _trackedDownloadCache.Set("tracked", newTrackedDownloads.Values.ToArray());