|
|
@ -1,5 +1,7 @@
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
using NLog;
|
|
|
|
using NLog;
|
|
|
|
using NzbDrone.Common;
|
|
|
|
using NzbDrone.Common;
|
|
|
@ -16,7 +18,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
|
|
|
void RemoveFrom(string source, string id, SabnzbdSettings settings);
|
|
|
|
void RemoveFrom(string source, string id, SabnzbdSettings settings);
|
|
|
|
string ProcessRequest(IRestRequest restRequest, string action, SabnzbdSettings settings);
|
|
|
|
string ProcessRequest(IRestRequest restRequest, string action, SabnzbdSettings settings);
|
|
|
|
SabnzbdVersionResponse GetVersion(SabnzbdSettings settings);
|
|
|
|
SabnzbdVersionResponse GetVersion(SabnzbdSettings settings);
|
|
|
|
SabnzbdCategoryResponse GetCategories(SabnzbdSettings settings);
|
|
|
|
List<String> GetCategories(SabnzbdSettings settings);
|
|
|
|
SabnzbdQueue GetQueue(int start, int limit, SabnzbdSettings settings);
|
|
|
|
SabnzbdQueue GetQueue(int start, int limit, SabnzbdSettings settings);
|
|
|
|
SabnzbdHistory GetHistory(int start, int limit, SabnzbdSettings settings);
|
|
|
|
SabnzbdHistory GetHistory(int start, int limit, SabnzbdSettings settings);
|
|
|
|
void RetryDownload(string id, SabnzbdSettings settings);
|
|
|
|
void RetryDownload(string id, SabnzbdSettings settings);
|
|
|
@ -83,12 +85,12 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
|
|
|
return response;
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public SabnzbdCategoryResponse GetCategories(SabnzbdSettings settings)
|
|
|
|
public List<String> GetCategories(SabnzbdSettings settings)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var request = new RestRequest();
|
|
|
|
var request = new RestRequest();
|
|
|
|
var action = "mode=get_cats";
|
|
|
|
var action = "mode=get_cats";
|
|
|
|
|
|
|
|
|
|
|
|
var response = Json.Deserialize<SabnzbdCategoryResponse>(ProcessRequest(request, action, settings));
|
|
|
|
var response = Json.Deserialize<SabnzbdCategoryResponse>(ProcessRequest(request, action, settings)).Categories;
|
|
|
|
|
|
|
|
|
|
|
|
return response;
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -134,7 +136,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
|
|
|
action,
|
|
|
|
action,
|
|
|
|
authentication);
|
|
|
|
authentication);
|
|
|
|
|
|
|
|
|
|
|
|
_logger.Debug(url);
|
|
|
|
_logger.Debug("Url: " + url);
|
|
|
|
|
|
|
|
|
|
|
|
return new RestClient(url);
|
|
|
|
return new RestClient(url);
|
|
|
|
}
|
|
|
|
}
|
|
|
|