Browse Source

Merge pull request #632 from bwitt/qbittorrent-fix-magnet-space

Fix stripping space out of links but keep spaces in name intact
pull/675/head
Eric Kok 1 month ago committed by GitHub
parent
commit
fd52a57963
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
  2. 2
      app/src/main/java/org/transdroid/daemon/task/AddByMagnetUrlTask.java

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

@ -985,7 +985,8 @@ public class TorrentsActivity extends AppCompatActivity implements TorrentTasksE @@ -985,7 +985,8 @@ 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, "UTF-8");
url = URLDecoder.decode(url.replaceAll("\\s", ""), "UTF-8");
title = URLDecoder.decode(title, "UTF-8");
} catch (UnsupportedEncodingException e) {
// Ignore: UTF-8 is always available on Android devices
} catch (IllegalArgumentException e) {

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").replaceAll("\\s", "");
return extras.getString("URL");
}
}

Loading…
Cancel
Save