mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-02 06:07:19 +02:00
Fixed: Already imported downloads appearing in Queue briefly
(cherry picked from commit 8099ba10afded446779290de29b1baaf0be932c3)
This commit is contained in:
parent
126a5b118e
commit
b5e6a36878
@ -38,6 +38,7 @@ public void SetUp()
|
||||
|
||||
_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 @@ public interface IQueueService
|
||||
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 @@ private Queue MapMovie(TrackedDownload trackedDownload, Movie movie)
|
||||
|
||||
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…
Reference in New Issue
Block a user