Browse Source

Allow setting up a proxy folder path with qBittorrent. Fixes #377.

pull/406/head
Eric Kok 7 years ago
parent
commit
23e30c1e6c
  1. 2
      app/src/main/java/org/transdroid/daemon/Daemon.java
  2. 7
      app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java

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

@ -315,7 +315,7 @@ public enum Daemon {
} }
public static boolean supportsCustomFolder(Daemon type) { public static boolean supportsCustomFolder(Daemon type) {
return type == rTorrent || type == Tfb4rt || type == Bitflu || type == Deluge || type == Transmission || type == BitTorrent || type == uTorrent || type == Dummy; return type == rTorrent || type == Tfb4rt || type == Bitflu || type == Deluge || type == Transmission || type == BitTorrent || type == uTorrent || type == qBittorrent || type == Dummy;
} }
public static boolean supportsSetTransferRates(Daemon type) { public static boolean supportsSetTransferRates(Daemon type) {

7
app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java

@ -415,7 +415,12 @@ public class QbittorrentAdapter implements IDaemonAdapter {
* @return The URL to request * @return The URL to request
*/ */
private String buildWebUIUrl(String path) { private String buildWebUIUrl(String path) {
return (settings.getSsl() ? "https://" : "http://") + settings.getAddress() + ":" + settings.getPort() + path; String proxyFolder = settings.getFolder();
if (proxyFolder == null)
proxyFolder = "";
else if (proxyFolder.endsWith("/"))
proxyFolder = proxyFolder.substring(0, proxyFolder.length() - 1);
return (settings.getSsl() ? "https://" : "http://") + settings.getAddress() + ":" + settings.getPort() + proxyFolder + path;
} }
private TorrentDetails parseJsonTorrentDetails(JSONArray messages) throws JSONException { private TorrentDetails parseJsonTorrentDetails(JSONArray messages) throws JSONException {

Loading…
Cancel
Save