mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 12:32:31 +01:00
rTorrent: Fix load commands
This commit is contained in:
parent
7a74327761
commit
90469630d1
@ -27,10 +27,10 @@ public interface IRTorrent : IXmlRpcProxy
|
|||||||
object[] TorrentMulticall(params string[] parameters);
|
object[] TorrentMulticall(params string[] parameters);
|
||||||
|
|
||||||
[XmlRpcMethod("load.start")]
|
[XmlRpcMethod("load.start")]
|
||||||
int LoadURL(string data);
|
int LoadURL(string target, string data);
|
||||||
|
|
||||||
[XmlRpcMethod("load.raw_start")]
|
[XmlRpcMethod("load.raw_start")]
|
||||||
int LoadBinary(byte[] data);
|
int LoadBinary(string target, byte[] data);
|
||||||
|
|
||||||
[XmlRpcMethod("d.erase")]
|
[XmlRpcMethod("d.erase")]
|
||||||
int Remove(string hash);
|
int Remove(string hash);
|
||||||
@ -133,7 +133,7 @@ public void AddTorrentFromUrl(string torrentUrl, RTorrentSettings settings)
|
|||||||
|
|
||||||
var client = BuildClient(settings);
|
var client = BuildClient(settings);
|
||||||
|
|
||||||
var response = client.LoadURL(torrentUrl);
|
var response = client.LoadURL("", torrentUrl);
|
||||||
if (response != 0)
|
if (response != 0)
|
||||||
{
|
{
|
||||||
throw new DownloadClientException("Could not add torrent: {0}.", torrentUrl);
|
throw new DownloadClientException("Could not add torrent: {0}.", torrentUrl);
|
||||||
@ -146,7 +146,7 @@ public void AddTorrentFromFile(string fileName, Byte[] fileContent, RTorrentSett
|
|||||||
|
|
||||||
var client = BuildClient(settings);
|
var client = BuildClient(settings);
|
||||||
|
|
||||||
var response = client.LoadBinary(fileContent);
|
var response = client.LoadBinary("", fileContent);
|
||||||
if (response != 0)
|
if (response != 0)
|
||||||
{
|
{
|
||||||
throw new DownloadClientException("Could not add torrent: {0}.", fileName);
|
throw new DownloadClientException("Could not add torrent: {0}.", fileName);
|
||||||
@ -194,15 +194,14 @@ public void SetTorrentLabel(string hash, string label, RTorrentSettings settings
|
|||||||
|
|
||||||
private IRTorrent BuildClient(RTorrentSettings settings)
|
private IRTorrent BuildClient(RTorrentSettings settings)
|
||||||
{
|
{
|
||||||
var url = string.Format(@"{0}://{1}:{2}/{3}",
|
var client = XmlRpcProxyGen.Create<IRTorrent>();
|
||||||
|
|
||||||
|
client.Url = string.Format(@"{0}://{1}:{2}/{3}",
|
||||||
settings.UseSsl ? "https" : "http",
|
settings.UseSsl ? "https" : "http",
|
||||||
settings.Host,
|
settings.Host,
|
||||||
settings.Port,
|
settings.Port,
|
||||||
settings.UrlBase);
|
settings.UrlBase);
|
||||||
|
|
||||||
var client = XmlRpcProxyGen.Create<IRTorrent>();
|
|
||||||
client.Url = url;
|
|
||||||
|
|
||||||
client.EnableCompression = true;
|
client.EnableCompression = true;
|
||||||
|
|
||||||
if (!settings.Username.IsNullOrWhiteSpace())
|
if (!settings.Username.IsNullOrWhiteSpace())
|
||||||
|
Loading…
Reference in New Issue
Block a user