mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
rTorrent: Fixed label bug
This commit is contained in:
parent
95017884d7
commit
7426efd423
@ -97,11 +97,13 @@ public List<RTorrentTorrent> GetTorrents(RTorrentSettings settings)
|
||||
var items = new List<RTorrentTorrent>();
|
||||
foreach (object[] torrent in ret)
|
||||
{
|
||||
var labelDecoded = System.Web.HttpUtility.UrlDecode((string) torrent[3]);
|
||||
|
||||
var item = new RTorrentTorrent();
|
||||
item.Name = (string) torrent[0];
|
||||
item.Hash = (string) torrent[1];
|
||||
item.Path = (string) torrent[2];
|
||||
item.Category = (string) torrent[3];
|
||||
item.Category = labelDecoded;
|
||||
item.TotalSize = (long) torrent[4];
|
||||
item.RemainingSize = (long) torrent[5];
|
||||
item.DownRate = (long) torrent[6];
|
||||
@ -172,10 +174,12 @@ public void SetTorrentLabel(string hash, string label, RTorrentSettings settings
|
||||
{
|
||||
_logger.Debug("Executing remote method: d.set_custom1");
|
||||
|
||||
var labelEncoded = System.Web.HttpUtility.UrlEncode(label);
|
||||
|
||||
var client = BuildClient(settings);
|
||||
|
||||
var setLabel = client.SetLabel(hash, label);
|
||||
if (setLabel != label)
|
||||
var setLabel = client.SetLabel(hash, labelEncoded);
|
||||
if (setLabel != labelEncoded)
|
||||
{
|
||||
throw new DownloadClientException("Could set label on torrent: {0}.", hash);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user