Browse Source

Treat Transmission folder setting as Transmission 2.2's new option rpc-url (effectively replacing the default /transmission folder); see issue 341.

pull/11/head
Eric Kok 12 years ago
parent
commit
2b14af7308
  1. 11
      lib/src/org/transdroid/daemon/Transmission/TransmissionAdapter.java

11
lib/src/org/transdroid/daemon/Transmission/TransmissionAdapter.java

@ -461,7 +461,16 @@ public class TransmissionAdapter implements IDaemonAdapter { @@ -461,7 +461,16 @@ public class TransmissionAdapter 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()) + "/transmission/rpc";
String folder = "/transmission";
if (settings.getFolder() == null || settings.getFolder().trim().isEmpty()) {
// Allow the user's folder setting to override /transmission (as per Transmission's rpc-url option)
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
+ "/rpc";
}
private ArrayList<Torrent> parseJsonRetrieveTorrents(JSONObject response) throws JSONException {

Loading…
Cancel
Save