From cb2418c8d1bad5a202dba723f0e2c3377a447899 Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Wed, 16 Jan 2013 14:33:48 +0100 Subject: [PATCH] Added support for deleting data on removing of torrent. (Thanks Tom Briden\!) --- lib/src/org/transdroid/daemon/Daemon.java | 2 +- .../org/transdroid/daemon/Rtorrent/RtorrentAdapter.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/src/org/transdroid/daemon/Daemon.java b/lib/src/org/transdroid/daemon/Daemon.java index 519f3b18..10826ac9 100644 --- a/lib/src/org/transdroid/daemon/Daemon.java +++ b/lib/src/org/transdroid/daemon/Daemon.java @@ -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) { diff --git a/lib/src/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java b/lib/src/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java index 544096eb..2907de12 100644 --- a/lib/src/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java +++ b/lib/src/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java @@ -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; @@ -131,8 +132,12 @@ public class RtorrentAdapter implements IDaemonAdapter { return new DaemonTaskSuccessResult(task); 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);