mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-25 22:46:31 -04:00
v3 API
This commit is contained in:
committed by
Taloth Saldono
parent
211f3769e1
commit
7297c1b8e4
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user