Browse Source

Merge pull request #674 from bwitt/bwitt/qb5-start-stop

Use start/stop for qbittorrent 5
pull/675/head
Eric Kok 1 month ago committed by GitHub
parent
commit
beb2dc350b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 21
      app/src/main/java/org/transdroid/daemon/adapters/qBittorrent/QBittorrentAdapter.java

21
app/src/main/java/org/transdroid/daemon/adapters/qBittorrent/QBittorrentAdapter.java

@ -345,7 +345,9 @@ public class QBittorrentAdapter implements IDaemonAdapter { @@ -345,7 +345,9 @@ public class QBittorrentAdapter implements IDaemonAdapter {
case Pause:
// Pause a torrent
if (version >= 40100) {
if (version >= 50000) {
makeRequest(log, "/api/v2/torrents/stop", new BasicNameValuePair("hashes", task.getTargetTorrent().getUniqueID()));
} else if (version >= 40100) {
makeRequest(log, "/api/v2/torrents/pause", new BasicNameValuePair("hashes", task.getTargetTorrent().getUniqueID()));
} else {
makeRequest(log, "/command/pause", new BasicNameValuePair("hash", task.getTargetTorrent().getUniqueID()));
@ -355,8 +357,10 @@ public class QBittorrentAdapter implements IDaemonAdapter { @@ -355,8 +357,10 @@ public class QBittorrentAdapter implements IDaemonAdapter {
case PauseAll:
// Resume all torrents
if (version >= 40100) {
// Pause all torrents
if (version >= 50000) {
makeRequest(log, "/api/v2/torrents/stop", new BasicNameValuePair("hashes", "all"));
} else if (version >= 40100) {
makeRequest(log, "/api/v2/torrents/pause", new BasicNameValuePair("hashes", "all"));
} else {
makeRequest(log, "/command/pauseall");
@ -367,7 +371,9 @@ public class QBittorrentAdapter implements IDaemonAdapter { @@ -367,7 +371,9 @@ public class QBittorrentAdapter implements IDaemonAdapter {
case Resume:
// Resume a torrent
if (version >= 40100) {
if (version >= 50000) {
makeRequest(log, "/api/v2/torrents/start", new BasicNameValuePair("hashes", task.getTargetTorrent().getUniqueID()));
} else if (version >= 40100) {
makeRequest(log, "/api/v2/torrents/resume", new BasicNameValuePair("hashes", task.getTargetTorrent().getUniqueID()));
} else {
makeRequest(log, "/command/resume", new BasicNameValuePair("hash", task.getTargetTorrent().getUniqueID()));
@ -378,9 +384,10 @@ public class QBittorrentAdapter implements IDaemonAdapter { @@ -378,9 +384,10 @@ public class QBittorrentAdapter implements IDaemonAdapter {
case ResumeAll:
// Resume all torrents
if (version >= 40100) {
path = "/api/v2/torrents/resume";
makeRequest(log, path, new BasicNameValuePair("hashes", "all"));
if (version >= 50000) {
makeRequest(log, "/api/v2/torrents/start", new BasicNameValuePair("hashes", "all"));
} else if (version >= 40100) {
makeRequest(log, "/api/v2/torrents/resume", new BasicNameValuePair("hashes", "all"));
} else {
makeRequest(log, "/command/resumeall");
}

Loading…
Cancel
Save