Browse Source

Fix stripping space out of links but keep spaces in name intact

pull/632/head
Brian Witt 2 years ago
parent
commit
a1c367c0e0
  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

@ -996,7 +996,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 // Since v39 Chrome sends application/x-www-form-urlencoded magnet links and most torrent clients do not understand those, so decode first
try { try {
url = URLDecoder.decode(url, "UTF-8"); url = URLDecoder.decode(url.replaceAll("\\s", ""), "UTF-8");
title = URLDecoder.decode(title, "UTF-8");
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
// Ignore: UTF-8 is always available on Android devices // Ignore: UTF-8 is always available on Android devices
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {

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

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

Loading…
Cancel
Save