rTorrent: Fixed label bug
This commit is contained in:
parent
95017884d7
commit
7426efd423
|
@ -97,11 +97,13 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
|
||||||
var items = new List<RTorrentTorrent>();
|
var items = new List<RTorrentTorrent>();
|
||||||
foreach (object[] torrent in ret)
|
foreach (object[] torrent in ret)
|
||||||
{
|
{
|
||||||
|
var labelDecoded = System.Web.HttpUtility.UrlDecode((string) torrent[3]);
|
||||||
|
|
||||||
var item = new RTorrentTorrent();
|
var item = new RTorrentTorrent();
|
||||||
item.Name = (string) torrent[0];
|
item.Name = (string) torrent[0];
|
||||||
item.Hash = (string) torrent[1];
|
item.Hash = (string) torrent[1];
|
||||||
item.Path = (string) torrent[2];
|
item.Path = (string) torrent[2];
|
||||||
item.Category = (string) torrent[3];
|
item.Category = labelDecoded;
|
||||||
item.TotalSize = (long) torrent[4];
|
item.TotalSize = (long) torrent[4];
|
||||||
item.RemainingSize = (long) torrent[5];
|
item.RemainingSize = (long) torrent[5];
|
||||||
item.DownRate = (long) torrent[6];
|
item.DownRate = (long) torrent[6];
|
||||||
|
@ -172,10 +174,12 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
|
||||||
{
|
{
|
||||||
_logger.Debug("Executing remote method: d.set_custom1");
|
_logger.Debug("Executing remote method: d.set_custom1");
|
||||||
|
|
||||||
|
var labelEncoded = System.Web.HttpUtility.UrlEncode(label);
|
||||||
|
|
||||||
var client = BuildClient(settings);
|
var client = BuildClient(settings);
|
||||||
|
|
||||||
var setLabel = client.SetLabel(hash, label);
|
var setLabel = client.SetLabel(hash, labelEncoded);
|
||||||
if (setLabel != label)
|
if (setLabel != labelEncoded)
|
||||||
{
|
{
|
||||||
throw new DownloadClientException("Could set label on torrent: {0}.", hash);
|
throw new DownloadClientException("Could set label on torrent: {0}.", hash);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue