1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-28 10:48:46 +00:00

Fixed regression in QueueService caused by pr650.

This commit is contained in:
Taloth Saldono 2015-07-11 22:49:38 +02:00
parent fd3dda2b16
commit 7bc4249ede

View file

@ -4,6 +4,7 @@ using System.Linq;
using NzbDrone.Common.Crypto;
using NzbDrone.Core.Download.TrackedDownloads;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Queue
{
@ -42,8 +43,21 @@ namespace NzbDrone.Core.Queue
}
private IEnumerable<Queue> MapQueue(TrackedDownload trackedDownload)
{
if (trackedDownload.RemoteEpisode.Episodes != null && trackedDownload.RemoteEpisode.Episodes.Any())
{
foreach (var episode in trackedDownload.RemoteEpisode.Episodes)
{
yield return MapEpisode(trackedDownload, episode);
}
}
else
{
// FIXME: Present queue items with unknown series/episodes
}
}
private Queue MapEpisode(TrackedDownload trackedDownload, Episode episode)
{
var queue = new Queue
{
@ -68,9 +82,7 @@ namespace NzbDrone.Core.Queue
queue.EstimatedCompletionTime = DateTime.UtcNow.Add(queue.Timeleft.Value);
}
yield return queue;
}
return queue;
}
}
}