Browse Source

Fixed qBittorrent support for setting of a label.

pull/406/head
Eric Kok 7 years ago
parent
commit
888212f405
  1. 2
      app/src/main/java/org/transdroid/daemon/Daemon.java
  2. 5
      app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java

2
app/src/main/java/org/transdroid/daemon/Daemon.java

@ -348,7 +348,7 @@ public enum Daemon {
} }
public static boolean supportsSetLabel(Daemon type) { 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) { public static boolean supportsSetDownloadLocation(Daemon type) {

5
app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java

@ -313,10 +313,9 @@ public class QbittorrentAdapter implements IDaemonAdapter {
case SetLabel: case SetLabel:
// TODO: This doesn't seem to work yet
SetLabelTask labelTask = (SetLabelTask) task; SetLabelTask labelTask = (SetLabelTask) task;
makeRequest(log, "/command/setCategory", makeRequest(log, "/command/setCategory",
new BasicNameValuePair("hash", task.getTargetTorrent().getUniqueID()), new BasicNameValuePair("hashes", task.getTargetTorrent().getUniqueID()),
new BasicNameValuePair("category", labelTask.getNewLabel())); new BasicNameValuePair("category", labelTask.getNewLabel()));
return new DaemonTaskSuccessResult(task); return new DaemonTaskSuccessResult(task);
@ -344,7 +343,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
if (serverStats != null) { if (serverStats != null) {
alternativeSpeeds = serverStats.optBoolean("use_alt_speed_limits"); alternativeSpeeds = serverStats.optBoolean("use_alt_speed_limits");
} }
return new GetStatsTaskSuccessResult((GetStatsTask) task, !alternativeSpeeds, -1); return new GetStatsTaskSuccessResult((GetStatsTask) task, alternativeSpeeds, -1);
case SetAlternativeMode: case SetAlternativeMode:

Loading…
Cancel
Save