Compare commits

..

No commits in common. 'fd52a5796306b19c844f2e3306babb6f0425ecc7' and '6e407a86a2d81be9294479c9dac4bd94c5a96879' have entirely different histories.

  1. 3
      app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
  2. 21
      app/src/main/java/org/transdroid/daemon/adapters/qBittorrent/QBittorrentAdapter.java
  3. 2
      app/src/main/java/org/transdroid/daemon/task/AddByMagnetUrlTask.java

3
app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java

@ -985,8 +985,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE @@ -985,8 +985,7 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE
// Since v39 Chrome sends application/x-www-form-urlencoded magnet links and most torrent clients do not understand those, so decode first
try {
url = URLDecoder.decode(url.replaceAll("\\s", ""), "UTF-8");
title = URLDecoder.decode(title, "UTF-8");
url = URLDecoder.decode(url, "UTF-8");
} catch (UnsupportedEncodingException e) {
// Ignore: UTF-8 is always available on Android devices
} catch (IllegalArgumentException e) {

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

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

2
app/src/main/java/org/transdroid/daemon/task/AddByMagnetUrlTask.java

@ -32,6 +32,6 @@ public class AddByMagnetUrlTask extends DaemonTask { @@ -32,6 +32,6 @@ public class AddByMagnetUrlTask extends DaemonTask {
return new AddByMagnetUrlTask(adapter, data);
}
public String getUrl() {
return extras.getString("URL");
return extras.getString("URL").replaceAll("\\s", "");
}
}

Loading…
Cancel
Save