Fixed regression in QueueService caused by pr650.
This commit is contained in:
parent
fd3dda2b16
commit
7bc4249ede
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||||
using NzbDrone.Common.Crypto;
|
using NzbDrone.Common.Crypto;
|
||||||
using NzbDrone.Core.Download.TrackedDownloads;
|
using NzbDrone.Core.Download.TrackedDownloads;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
|
using NzbDrone.Core.Tv;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Queue
|
namespace NzbDrone.Core.Queue
|
||||||
{
|
{
|
||||||
|
@ -42,8 +43,21 @@ namespace NzbDrone.Core.Queue
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<Queue> MapQueue(TrackedDownload trackedDownload)
|
private IEnumerable<Queue> MapQueue(TrackedDownload trackedDownload)
|
||||||
|
{
|
||||||
|
if (trackedDownload.RemoteEpisode.Episodes != null && trackedDownload.RemoteEpisode.Episodes.Any())
|
||||||
{
|
{
|
||||||
foreach (var episode in trackedDownload.RemoteEpisode.Episodes)
|
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
|
var queue = new Queue
|
||||||
{
|
{
|
||||||
|
@ -68,9 +82,7 @@ namespace NzbDrone.Core.Queue
|
||||||
queue.EstimatedCompletionTime = DateTime.UtcNow.Add(queue.Timeleft.Value);
|
queue.EstimatedCompletionTime = DateTime.UtcNow.Add(queue.Timeleft.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return queue;
|
return queue;
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue