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
5 changed files with 7 additions and 11 deletions

View File

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

View File

@@ -46,7 +46,6 @@ namespace NzbDrone.Core.Test.QueueTests
_trackedDownloads = Builder<TrackedDownload>.CreateListOfSize(1)
.All()
.With(v => v.IsTrackable = true)
.With(v => v.DownloadItem = downloadItem)
.With(v => v.RemoteBook = remoteBook)
.Build()

View File

@@ -62,8 +62,8 @@ namespace NzbDrone.Core.Download
public void Check(TrackedDownload trackedDownload)
{
// Only process tracked downloads that are still downloading
if (trackedDownload.State != TrackedDownloadState.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 && trackedDownload.State != TrackedDownloadState.ImportBlocked)
{
return;
}

View File

@@ -115,7 +115,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
{
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);
_completedDownloadService.Check(trackedDownload);

View File

@@ -20,7 +20,7 @@ namespace NzbDrone.Core.Queue
public class QueueService : IQueueService, IHandle<TrackedDownloadRefreshedEvent>
{
private readonly IEventAggregator _eventAggregator;
private static List<Queue> _queue = new ();
private static List<Queue> _queue = new List<Queue>();
private readonly IHistoryService _historyService;
public QueueService(IEventAggregator eventAggregator,
@@ -105,11 +105,8 @@ namespace NzbDrone.Core.Queue
public void Handle(TrackedDownloadRefreshedEvent message)
{
_queue = message.TrackedDownloads
.Where(t => t.IsTrackable)
.OrderBy(c => c.DownloadItem.RemainingTime)
.SelectMany(MapQueue)
.ToList();
_queue = message.TrackedDownloads.OrderBy(c => c.DownloadItem.RemainingTime).SelectMany(MapQueue)
.ToList();
_eventAggregator.PublishEvent(new QueueUpdatedEvent());
}