diff --git a/app/src/main/java/org/transdroid/daemon/Daemon.java b/app/src/main/java/org/transdroid/daemon/Daemon.java index dcc27416..9d02d30b 100644 --- a/app/src/main/java/org/transdroid/daemon/Daemon.java +++ b/app/src/main/java/org/transdroid/daemon/Daemon.java @@ -315,7 +315,7 @@ public enum Daemon { } public static boolean supportsCustomFolder(Daemon type) { - return type == rTorrent || type == Tfb4rt || type == Bitflu || type == Deluge || type == Transmission || type == Dummy; + return type == rTorrent || type == Tfb4rt || type == Bitflu || type == Deluge || type == Transmission || type == BitTorrent || type == uTorrent || type == Dummy; } public static boolean supportsSetTransferRates(Daemon type) { diff --git a/app/src/main/java/org/transdroid/daemon/Utorrent/UtorrentAdapter.java b/app/src/main/java/org/transdroid/daemon/Utorrent/UtorrentAdapter.java index 9dd57284..342cf5d1 100644 --- a/app/src/main/java/org/transdroid/daemon/Utorrent/UtorrentAdapter.java +++ b/app/src/main/java/org/transdroid/daemon/Utorrent/UtorrentAdapter.java @@ -437,8 +437,16 @@ public class UtorrentAdapter implements IDaemonAdapter { * @return The URL of the RPC API */ private String buildWebUIUrl() { - return (settings.getSsl() ? "https://" : "http://") + settings.getAddress() + ":" + settings.getPort() + - "/gui/"; + String folder = settings.getFolder() == null ? "" : settings.getFolder().trim(); + if (!folder.startsWith("/")) { + // Add leading slash + folder = "/" + folder; + } + if (folder.endsWith("/")) { + // Strip trailing slash + folder = folder.substring(0, folder.length() - 1); + } + return (settings.getSsl() ? "https://" : "http://") + settings.getAddress().trim() + ":" + settings.getPort() + folder + "/gui/"; } private TorrentStatus convertUtorrentStatus(int uStatus, boolean finished) {