1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-25 22:46:31 -04:00
This commit is contained in:
Mark McDowall
2017-02-10 22:46:39 -08:00
committed by Taloth Saldono
parent 211f3769e1
commit 7297c1b8e4
399 changed files with 10618 additions and 1043 deletions
+10 -1
View File
@@ -12,6 +12,7 @@ namespace NzbDrone.Core.Queue
{
List<Queue> GetQueue();
Queue Find(int id);
void Remove(int id);
}
public class QueueService : IQueueService, IHandle<TrackedDownloadRefreshedEvent>
@@ -34,6 +35,11 @@ namespace NzbDrone.Core.Queue
return _queue.SingleOrDefault(q => q.Id == id);
}
public void Remove(int id)
{
_queue.Remove(Find(id));
}
public void Handle(TrackedDownloadRefreshedEvent message)
{
_queue = message.TrackedDownloads.OrderBy(c => c.DownloadItem.RemainingTime).SelectMany(MapQueue)
@@ -72,9 +78,12 @@ namespace NzbDrone.Core.Queue
Status = trackedDownload.DownloadItem.Status.ToString(),
TrackedDownloadStatus = trackedDownload.Status.ToString(),
StatusMessages = trackedDownload.StatusMessages.ToList(),
ErrorMessage = trackedDownload.DownloadItem.Message,
RemoteEpisode = trackedDownload.RemoteEpisode,
DownloadId = trackedDownload.DownloadItem.DownloadId,
Protocol = trackedDownload.Protocol
Protocol = trackedDownload.Protocol,
DownloadClient = trackedDownload.DownloadItem.DownloadClient,
Indexer = trackedDownload.Indexer
};
if (queue.Timeleft.HasValue)