Browse Source

Remove all whitespace from URL when adding

The use case is fairly specific. This allows copying and pasting URLs from a command line session where the URL wraps inside the terminal, which injects whitespace in the middle of the URL. Removing the whitespace manually is tedious. This handles it in the app.

Risk: Low
pull/551/head
Jonathan Simon 5 years ago
parent
commit
f78762fb88
  1. 2
      app/src/main/java/org/transdroid/daemon/task/AddByMagnetUrlTask.java
  2. 2
      app/src/main/java/org/transdroid/daemon/task/AddByUrlTask.java

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

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

@ -33,7 +33,7 @@ public class AddByUrlTask extends DaemonTask {
return new AddByUrlTask(adapter, data); return new AddByUrlTask(adapter, data);
} }
public String getUrl() { public String getUrl() {
return extras.getString("URL"); return extras.getString("URL").replaceAll("\\s", "");
} }
public String getTitle() { public String getTitle() {
return extras.getString("TITLE"); return extras.getString("TITLE");

Loading…
Cancel
Save