Fixed regression in QueueService caused by pr650.

pull/6/head
Taloth Saldono 9 years ago
parent fd3dda2b16
commit 7bc4249ede

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

Loading…
Cancel
Save