Browse Source

Merge pull request #585 from Exagone313/deluge-folder-remove-trailing-slash

Remove trailing slash from folder in deluge adapter
pull/596/head
Eric Kok 3 years ago committed by GitHub
parent
commit
2e6d373fd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      app/src/main/java/org/transdroid/daemon/adapters/deluge/DelugeAdapter.java

11
app/src/main/java/org/transdroid/daemon/adapters/deluge/DelugeAdapter.java

@ -595,8 +595,15 @@ public class DelugeAdapter implements IDaemonAdapter { @@ -595,8 +595,15 @@ public class DelugeAdapter implements IDaemonAdapter {
* @return The URL of the RPC API
*/
private String buildWebUIUrl() {
return (settings.getSsl() ? "https://" : "http://") + settings.getAddress() + ":" + settings.getPort() + (settings.getFolder() == null ? ""
: settings.getFolder());
String folder = "";
if (settings.getFolder() != null) {
folder = settings.getFolder().trim();
// Strip any trailing slashes
if (folder.endsWith("/")) {
folder = folder.substring(0, folder.length() - 1);
}
}
return (settings.getSsl() ? "https://" : "http://") + settings.getAddress() + ":" + settings.getPort() + folder;
}
private ArrayList<Torrent> parseJsonRetrieveTorrents(JSONObject response) throws JSONException, DaemonException {

Loading…
Cancel
Save