mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-23 08:15:27 +00:00
Fixed: Already imported downloads appearing in Queue briefly
This commit is contained in:
parent
143ccb1e2a
commit
8099ba10af
2 changed files with 7 additions and 3 deletions
|
@ -44,6 +44,7 @@ namespace NzbDrone.Core.Test.QueueTests
|
||||||
|
|
||||||
_trackedDownloads = Builder<TrackedDownload>.CreateListOfSize(1)
|
_trackedDownloads = Builder<TrackedDownload>.CreateListOfSize(1)
|
||||||
.All()
|
.All()
|
||||||
|
.With(v => v.IsTrackable = true)
|
||||||
.With(v => v.DownloadItem = downloadItem)
|
.With(v => v.DownloadItem = downloadItem)
|
||||||
.With(v => v.RemoteEpisode = remoteEpisode)
|
.With(v => v.RemoteEpisode = remoteEpisode)
|
||||||
.Build()
|
.Build()
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace NzbDrone.Core.Queue
|
||||||
public class QueueService : IQueueService, IHandle<TrackedDownloadRefreshedEvent>
|
public class QueueService : IQueueService, IHandle<TrackedDownloadRefreshedEvent>
|
||||||
{
|
{
|
||||||
private readonly IEventAggregator _eventAggregator;
|
private readonly IEventAggregator _eventAggregator;
|
||||||
private static List<Queue> _queue = new List<Queue>();
|
private static List<Queue> _queue = new ();
|
||||||
|
|
||||||
public QueueService(IEventAggregator eventAggregator)
|
public QueueService(IEventAggregator eventAggregator)
|
||||||
{
|
{
|
||||||
|
@ -96,8 +96,11 @@ namespace NzbDrone.Core.Queue
|
||||||
|
|
||||||
public void Handle(TrackedDownloadRefreshedEvent message)
|
public void Handle(TrackedDownloadRefreshedEvent message)
|
||||||
{
|
{
|
||||||
_queue = message.TrackedDownloads.OrderBy(c => c.DownloadItem.RemainingTime).SelectMany(MapQueue)
|
_queue = message.TrackedDownloads
|
||||||
.ToList();
|
.Where(t => t.IsTrackable)
|
||||||
|
.OrderBy(c => c.DownloadItem.RemainingTime)
|
||||||
|
.SelectMany(MapQueue)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
_eventAggregator.PublishEvent(new QueueUpdatedEvent());
|
_eventAggregator.PublishEvent(new QueueUpdatedEvent());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue