Browse Source

Added support for deleting data on removing of torrent. (Thanks Tom Briden\!)

pull/11/head
Eric Kok 12 years ago
parent
commit
cb2418c8d1
  1. 2
      lib/src/org/transdroid/daemon/Daemon.java
  2. 5
      lib/src/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java

2
lib/src/org/transdroid/daemon/Daemon.java

@ -239,7 +239,7 @@ public enum Daemon { @@ -239,7 +239,7 @@ public enum Daemon {
}
public static boolean supportsRemoveWithData(Daemon type) {
return type == uTorrent || type == Vuze || type == Transmission || type == Deluge || type == BitTorrent || type == Tfb4rt || type == DLinkRouterBT || type == Bitflu || type == qBittorrent || type == BuffaloNas || type == BitComet;
return type == uTorrent || type == Vuze || type == Transmission || type == Deluge || type == BitTorrent || type == Tfb4rt || type == DLinkRouterBT || type == Bitflu || type == qBittorrent || type == BuffaloNas || type == BitComet || type == rTorrent;
}
public static boolean supportsFilePrioritySetting(Daemon type) {

5
lib/src/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java

@ -49,6 +49,7 @@ import org.transdroid.daemon.task.GetFileListTask; @@ -49,6 +49,7 @@ import org.transdroid.daemon.task.GetFileListTask;
import org.transdroid.daemon.task.GetFileListTaskSuccessResult;
import org.transdroid.daemon.task.GetTorrentDetailsTask;
import org.transdroid.daemon.task.GetTorrentDetailsTaskSuccessResult;
import org.transdroid.daemon.task.RemoveTask;
import org.transdroid.daemon.task.RetrieveTask;
import org.transdroid.daemon.task.RetrieveTaskSuccessResult;
import org.transdroid.daemon.task.SetFilePriorityTask;
@ -133,6 +134,10 @@ public class RtorrentAdapter implements IDaemonAdapter { @@ -133,6 +134,10 @@ public class RtorrentAdapter implements IDaemonAdapter {
case Remove:
// Remove a torrent
RemoveTask removeTask = (RemoveTask) task;
if (removeTask.includingData()) {
makeRtorrentCall("d.set_custom5", new String[] { task.getTargetTorrent().getUniqueID(), "1" });
}
makeRtorrentCall("d.erase", new String[] { task.getTargetTorrent().getUniqueID() });
return new DaemonTaskSuccessResult(task);

Loading…
Cancel
Save