mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Fixed SabProvider and Unit Tests for it.
This commit is contained in:
parent
13ab28586f
commit
445e2f59b9
2 changed files with 54 additions and 42 deletions
|
@ -24,8 +24,9 @@ namespace NzbDrone.Core.Providers
|
|||
public bool AddByUrl(string url, string title)
|
||||
{
|
||||
const string mode = "addurl";
|
||||
const string cat = "tv";
|
||||
string priority = _config.GetValue("Priority", String.Empty, false);
|
||||
//string cat = _config.GetValue("SabCategory", String.Empty, true);
|
||||
string cat = "tv";
|
||||
string priority = _config.GetValue("SabPriority", String.Empty, false);
|
||||
string name = url.Replace("&", "%26");
|
||||
string nzbName = HttpUtility.UrlEncode(title);
|
||||
|
||||
|
@ -73,12 +74,12 @@ namespace NzbDrone.Core.Providers
|
|||
|
||||
private string GetSabRequest(string action)
|
||||
{
|
||||
string sabnzbdInfo = _config.GetValue("SabnzbdInfo", String.Empty, false);
|
||||
string username = _config.GetValue("Username", String.Empty, false);
|
||||
string password = _config.GetValue("Password", String.Empty, false);
|
||||
string apiKey = _config.GetValue("ApiKey", String.Empty, false);
|
||||
string sabnzbdInfo = _config.GetValue("SabHost", String.Empty, false) + ":" + _config.GetValue("SabPort", String.Empty, false);
|
||||
string username = _config.GetValue("SabUsername", String.Empty, false);
|
||||
string password = _config.GetValue("SabPassword", String.Empty, false);
|
||||
string apiKey = _config.GetValue("SabApiKey", String.Empty, false);
|
||||
|
||||
return string.Format(@"http://{0}/sabnzbd/api?$Action&apikey={1}&ma_username={2}&ma_password={3}", sabnzbdInfo, apiKey, username, password).Replace("$Action", action);
|
||||
return string.Format(@"http://{0}/api?$Action&apikey={1}&ma_username={2}&ma_password={3}", sabnzbdInfo, apiKey, username, password).Replace("$Action", action);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue