Compare commits

..

1 Commits

Author SHA1 Message Date
Mark McDowall
48b9f0a07a Fixed: Reprocessing items that were previously blocked during importing
(cherry picked from commit bce848facf8aeaeac6a1d59c92941d00589034a4)
2024-06-26 16:48:48 +00:00
4 changed files with 6 additions and 14 deletions

View File

@@ -20,7 +20,7 @@ variables:
innoVersion: '6.2.0' innoVersion: '6.2.0'
windowsImage: 'windows-2022' windowsImage: 'windows-2022'
linuxImage: 'ubuntu-20.04' linuxImage: 'ubuntu-20.04'
macImage: 'macOS-12' macImage: 'macOS-11'
trigger: trigger:
branches: branches:

View File

@@ -62,8 +62,8 @@ namespace NzbDrone.Core.Download
public void Check(TrackedDownload trackedDownload) public void Check(TrackedDownload trackedDownload)
{ {
// Only process tracked downloads that are still downloading // Only process tracked downloads that are still downloading or import is blocked (if they fail after attempting to be processed)
if (trackedDownload.State != TrackedDownloadState.Downloading) if (trackedDownload.State != TrackedDownloadState.Downloading && trackedDownload.State != TrackedDownloadState.ImportBlocked)
{ {
return; return;
} }

View File

@@ -115,7 +115,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
{ {
var trackedDownload = _trackedDownloadService.TrackDownload((DownloadClientDefinition)downloadClient.Definition, downloadItem); var trackedDownload = _trackedDownloadService.TrackDownload((DownloadClientDefinition)downloadClient.Definition, downloadItem);
if (trackedDownload != null && trackedDownload.State == TrackedDownloadState.Downloading) if (trackedDownload is { State: TrackedDownloadState.Downloading or TrackedDownloadState.ImportBlocked })
{ {
_failedDownloadService.Check(trackedDownload); _failedDownloadService.Check(trackedDownload);
_completedDownloadService.Check(trackedDownload); _completedDownloadService.Check(trackedDownload);

View File

@@ -1,26 +1,18 @@
using NzbDrone.Core.Configuration; using NzbDrone.Core.Instrumentation;
using NzbDrone.Core.Instrumentation;
namespace NzbDrone.Core.Housekeeping.Housekeepers namespace NzbDrone.Core.Housekeeping.Housekeepers
{ {
public class TrimLogDatabase : IHousekeepingTask public class TrimLogDatabase : IHousekeepingTask
{ {
private readonly ILogRepository _logRepo; private readonly ILogRepository _logRepo;
private readonly IConfigFileProvider _configFileProvider;
public TrimLogDatabase(ILogRepository logRepo, IConfigFileProvider configFileProvider) public TrimLogDatabase(ILogRepository logRepo)
{ {
_logRepo = logRepo; _logRepo = logRepo;
_configFileProvider = configFileProvider;
} }
public void Clean() public void Clean()
{ {
if (!_configFileProvider.LogDbEnabled)
{
return;
}
_logRepo.Trim(); _logRepo.Trim();
} }
} }