diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs index 7f4351caf..f74237dae 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs @@ -174,7 +174,7 @@ protected virtual void GivenHistory(SabnzbdHistory history) } Mocker.GetMock() - .Setup(s => s.GetHistory(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.GetHistory(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(history); } diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs index 9f22c4328..af3cbf863 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs @@ -107,7 +107,7 @@ private IEnumerable GetQueue() private IEnumerable GetHistory() { - var sabHistory = _proxy.GetHistory(0, _configService.DownloadClientHistoryLimit, Settings.MovieCategory, Settings); + var sabHistory = _proxy.GetHistory(0, _configService.DownloadClientHistoryLimit, Settings); var historyItems = new List(); diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs index 6b75df782..998455afb 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs @@ -19,7 +19,7 @@ public interface ISabnzbdProxy SabnzbdConfig GetConfig(SabnzbdSettings settings); SabnzbdFullStatus GetFullStatus(SabnzbdSettings settings); SabnzbdQueue GetQueue(int start, int limit, SabnzbdSettings settings); - SabnzbdHistory GetHistory(int start, int limit, string category, SabnzbdSettings settings); + SabnzbdHistory GetHistory(int start, int limit, SabnzbdSettings settings); string RetryDownload(string id, SabnzbdSettings settings); } @@ -46,7 +46,7 @@ public SabnzbdAddResponse DownloadNzb(byte[] nzbData, string filename, string ca { var request = BuildRequest("addfile", settings).Post(); - request.AddQueryParam("cat", category); + request.AddQueryParam("cat", settings.MovieCategory); request.AddQueryParam("priority", priority); request.AddFormUpload("name", filename, nzbData, "application/x-nzb"); @@ -111,20 +111,25 @@ public SabnzbdQueue GetQueue(int start, int limit, SabnzbdSettings settings) request.AddQueryParam("start", start); request.AddQueryParam("limit", limit); + if (settings.MovieCategory.IsNotNullOrWhiteSpace()) + { + request.AddQueryParam("category", settings.MovieCategory); + } + var response = ProcessRequest(request, settings); return Json.Deserialize(JObject.Parse(response).SelectToken("queue").ToString()); } - public SabnzbdHistory GetHistory(int start, int limit, string category, SabnzbdSettings settings) + public SabnzbdHistory GetHistory(int start, int limit, SabnzbdSettings settings) { var request = BuildRequest("history", settings); request.AddQueryParam("start", start); request.AddQueryParam("limit", limit); - if (category.IsNotNullOrWhiteSpace()) + if (settings.MovieCategory.IsNotNullOrWhiteSpace()) { - request.AddQueryParam("category", category); + request.AddQueryParam("category", settings.MovieCategory); } var response = ProcessRequest(request, settings);