mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 04:22:30 +01:00
Remove PostQueue from NzbGetProxy coz it's useless anyway.
This commit is contained in:
parent
c0a46e04b8
commit
374fe07aba
@ -119,10 +119,6 @@ protected virtual void GivenQueue(NzbgetQueueItem queue)
|
||||
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 @@ private IEnumerable<DownloadClientItem> GetQueue()
|
||||
{
|
||||
globalStatus = _proxy.GetGlobalStatus(Settings);
|
||||
queue = _proxy.GetQueue(Settings);
|
||||
postQueue = _proxy.GetPostQueue(Settings).ToDictionary(v => v.NzbId);
|
||||
}
|
||||
catch (DownloadClientException ex)
|
||||
{
|
||||
@ -65,8 +64,6 @@ private IEnumerable<DownloadClientItem> GetQueue()
|
||||
|
||||
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 @@ private IEnumerable<DownloadClientItem> GetQueue()
|
||||
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 @@ public interface INzbgetProxy
|
||||
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 @@ public List<NzbgetQueueItem> GetQueue(NzbgetSettings settings)
|
||||
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…
Reference in New Issue
Block a user