1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-10-02 14:17:19 +02:00

Fixed: Already imported downloads appearing in Queue briefly

(cherry picked from commit 8099ba10afded446779290de29b1baaf0be932c3)
This commit is contained in:
Bogdan 2024-06-30 20:47:00 +03:00
parent 126a5b118e
commit b5e6a36878
2 changed files with 7 additions and 3 deletions

View File

@ -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()

View File

@ -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());
}