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