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