mirror of
https://github.com/Radarr/Radarr.git
synced 2025-04-23 14:07:20 -04:00
Fixed: Already imported downloads appearing in Queue briefly
(cherry picked from commit 8099ba10afded446779290de29b1baaf0be932c3)
This commit is contained in:
parent
126a5b118e
commit
b5e6a36878
2 changed files with 7 additions and 3 deletions
|
@ -38,6 +38,7 @@ namespace NzbDrone.Core.Test.QueueTests
|
|||
|
||||
_trackedDownloads = Builder<TrackedDownload>.CreateListOfSize(1)
|
||||
.All()
|
||||
.With(v => v.IsTrackable = true)
|
||||
.With(v => v.DownloadItem = downloadItem)
|
||||
.With(v => v.RemoteMovie = remoteEpisode)
|
||||
.Build()
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace NzbDrone.Core.Queue
|
|||
public class QueueService : IQueueService, IHandle<TrackedDownloadRefreshedEvent>
|
||||
{
|
||||
private readonly IEventAggregator _eventAggregator;
|
||||
private static List<Queue> _queue = new List<Queue>();
|
||||
private static List<Queue> _queue = new ();
|
||||
|
||||
public QueueService(IEventAggregator eventAggregator)
|
||||
{
|
||||
|
@ -92,8 +92,11 @@ namespace NzbDrone.Core.Queue
|
|||
|
||||
public void Handle(TrackedDownloadRefreshedEvent message)
|
||||
{
|
||||
_queue = message.TrackedDownloads.OrderBy(c => c.DownloadItem.RemainingTime).SelectMany(MapQueue)
|
||||
.ToList();
|
||||
_queue = message.TrackedDownloads
|
||||
.Where(t => t.IsTrackable)
|
||||
.OrderBy(c => c.DownloadItem.RemainingTime)
|
||||
.SelectMany(MapQueue)
|
||||
.ToList();
|
||||
|
||||
_eventAggregator.PublishEvent(new QueueUpdatedEvent());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue