From 888212f405fa1e7a56406e25d2fb4ba1a9c674d8 Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Fri, 17 Nov 2017 21:38:41 +0100 Subject: [PATCH] Fixed qBittorrent support for setting of a label. --- app/src/main/java/org/transdroid/daemon/Daemon.java | 2 +- .../transdroid/daemon/Qbittorrent/QbittorrentAdapter.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/transdroid/daemon/Daemon.java b/app/src/main/java/org/transdroid/daemon/Daemon.java index 9c468dc7..37d9e318 100644 --- a/app/src/main/java/org/transdroid/daemon/Daemon.java +++ b/app/src/main/java/org/transdroid/daemon/Daemon.java @@ -348,7 +348,7 @@ public enum Daemon { } public static boolean supportsSetLabel(Daemon type) { - return type == uTorrent || type == BitTorrent || type == rTorrent || type == Deluge || type == Dummy; + return type == uTorrent || type == BitTorrent || type == rTorrent || type == Deluge || type == qBittorrent || type == Dummy; } public static boolean supportsSetDownloadLocation(Daemon type) { diff --git a/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java b/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java index e06a6942..8e77ad6a 100644 --- a/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java +++ b/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java @@ -313,10 +313,9 @@ public class QbittorrentAdapter implements IDaemonAdapter { case SetLabel: - // TODO: This doesn't seem to work yet SetLabelTask labelTask = (SetLabelTask) task; makeRequest(log, "/command/setCategory", - new BasicNameValuePair("hash", task.getTargetTorrent().getUniqueID()), + new BasicNameValuePair("hashes", task.getTargetTorrent().getUniqueID()), new BasicNameValuePair("category", labelTask.getNewLabel())); return new DaemonTaskSuccessResult(task); @@ -344,7 +343,7 @@ public class QbittorrentAdapter implements IDaemonAdapter { if (serverStats != null) { alternativeSpeeds = serverStats.optBoolean("use_alt_speed_limits"); } - return new GetStatsTaskSuccessResult((GetStatsTask) task, !alternativeSpeeds, -1); + return new GetStatsTaskSuccessResult((GetStatsTask) task, alternativeSpeeds, -1); case SetAlternativeMode: