Browse Source

Allow setting of a folder with uTorrent for reverse proxy setups. Folder comes before the fixed /gui. Fixes #277.

pull/311/head
Eric Kok 9 years ago
parent
commit
bb96064bcc
  1. 2
      app/src/main/java/org/transdroid/daemon/Daemon.java
  2. 12
      app/src/main/java/org/transdroid/daemon/Utorrent/UtorrentAdapter.java

2
app/src/main/java/org/transdroid/daemon/Daemon.java

@ -315,7 +315,7 @@ public enum Daemon { @@ -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) {

12
app/src/main/java/org/transdroid/daemon/Utorrent/UtorrentAdapter.java

@ -437,8 +437,16 @@ public class UtorrentAdapter implements IDaemonAdapter { @@ -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) {

Loading…
Cancel
Save