Remove PostQueue from NzbGetProxy coz it's useless anyway.

pull/3113/head
Taloth Saldono 10 years ago
parent c0a46e04b8
commit 374fe07aba

@ -119,10 +119,6 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests
Mocker.GetMock<INzbgetProxy>()
.Setup(s => s.GetQueue(It.IsAny<NzbgetSettings>()))
.Returns(list);
Mocker.GetMock<INzbgetProxy>()
.Setup(s => s.GetPostQueue(It.IsAny<NzbgetSettings>()))
.Returns(new List<NzbgetPostQueueItem>());
}
protected virtual void GivenHistory(NzbgetHistoryItem history)

@ -51,7 +51,6 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
{
globalStatus = _proxy.GetGlobalStatus(Settings);
queue = _proxy.GetQueue(Settings);
postQueue = _proxy.GetPostQueue(Settings).ToDictionary(v => v.NzbId);
}
catch (DownloadClientException ex)
{
@ -65,8 +64,6 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
foreach (var item in queue)
{
var postQueueItem = postQueue.GetValueOrDefault(item.NzbId);
var totalSize = MakeInt64(item.FileSizeHi, item.FileSizeLo);
var pausedSize = MakeInt64(item.PausedSizeHi, item.PausedSizeLo);
var remainingSize = MakeInt64(item.RemainingSizeHi, item.RemainingSizeLo);
@ -79,17 +76,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
queueItem.TotalSize = totalSize;
queueItem.Category = item.Category;
if (postQueueItem != null)
{
queueItem.Status = DownloadItemStatus.Downloading;
queueItem.Message = postQueueItem.ProgressLabel;
if (postQueueItem.StageProgress != 0)
{
queueItem.RemainingTime = TimeSpan.FromSeconds(postQueueItem.StageTimeSec * 1000 / postQueueItem.StageProgress - postQueueItem.StageTimeSec);
}
}
else if (globalStatus.DownloadPaused || remainingSize == pausedSize)
if (globalStatus.DownloadPaused || remainingSize == pausedSize)
{
queueItem.Status = DownloadItemStatus.Paused;
queueItem.RemainingSize = remainingSize;

@ -13,7 +13,6 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
string DownloadNzb(Byte[] nzbData, string title, string category, int priority, NzbgetSettings settings);
NzbgetGlobalStatus GetGlobalStatus(NzbgetSettings settings);
List<NzbgetQueueItem> GetQueue(NzbgetSettings settings);
List<NzbgetPostQueueItem> GetPostQueue(NzbgetSettings settings);
List<NzbgetHistoryItem> GetHistory(NzbgetSettings settings);
String GetVersion(NzbgetSettings settings);
Dictionary<String, String> GetConfig(NzbgetSettings settings);
@ -76,13 +75,6 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
return Json.Deserialize<NzbgetResponse<List<NzbgetQueueItem>>>(ProcessRequest(request, settings)).Result;
}
public List<NzbgetPostQueueItem> GetPostQueue(NzbgetSettings settings)
{
var request = BuildRequest(new JsonRequest("postqueue"));
return Json.Deserialize<NzbgetResponse<List<NzbgetPostQueueItem>>>(ProcessRequest(request, settings)).Result;
}
public List<NzbgetHistoryItem> GetHistory(NzbgetSettings settings)
{
var request = BuildRequest(new JsonRequest("history"));

Loading…
Cancel
Save