|
|
@ -226,49 +226,51 @@ public class RtorrentAdapter implements IDaemonAdapter { |
|
|
|
case Pause: |
|
|
|
case Pause: |
|
|
|
|
|
|
|
|
|
|
|
// Pause a torrent
|
|
|
|
// Pause a torrent
|
|
|
|
makeRtorrentCall(log, "d.pause", new String[]{task.getTargetTorrent().getUniqueID()}); |
|
|
|
makeRtorrentCall(log, "d.stop", new String[]{task.getTargetTorrent().getUniqueID()}); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
|
|
|
|
|
|
|
|
case PauseAll: |
|
|
|
case PauseAll: |
|
|
|
|
|
|
|
|
|
|
|
// Resume all torrents
|
|
|
|
// Resume all torrents
|
|
|
|
makeRtorrentCall(log, "d.multicall2", new String[]{"","main", "d.pause="}); |
|
|
|
makeRtorrentCall(log, "d.multicall2", new String[]{"","main", "d.stop="}); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
|
|
|
|
|
|
|
|
case Resume: |
|
|
|
case Resume: |
|
|
|
|
|
|
|
|
|
|
|
// Resume a torrent
|
|
|
|
// Resume a torrent
|
|
|
|
makeRtorrentCall(log, "d.resume", new String[]{task.getTargetTorrent().getUniqueID()}); |
|
|
|
makeRtorrentCall(log, "d.start", new String[]{task.getTargetTorrent().getUniqueID()}); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
|
|
|
|
|
|
|
|
case ResumeAll: |
|
|
|
case ResumeAll: |
|
|
|
|
|
|
|
|
|
|
|
// Resume all torrents
|
|
|
|
// Resume all torrents
|
|
|
|
makeRtorrentCall(log, "d.multicall2", new String[]{"", "main", "d.resume="}); |
|
|
|
makeRtorrentCall(log, "d.multicall2", new String[]{"", "main", "d.start="}); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
|
|
|
|
|
|
|
|
case Stop: |
|
|
|
case Stop: |
|
|
|
|
|
|
|
|
|
|
|
// Stop a torrent
|
|
|
|
// Stop a torrent
|
|
|
|
makeRtorrentCall(log, "d.stop", new String[]{task.getTargetTorrent().getUniqueID()}); |
|
|
|
makeRtorrentCall(log, "d.stop", new String[]{task.getTargetTorrent().getUniqueID()}); |
|
|
|
|
|
|
|
makeRtorrentCall(log, "d.close", new String[]{task.getTargetTorrent().getUniqueID()}); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
|
|
|
|
|
|
|
|
case StopAll: |
|
|
|
case StopAll: |
|
|
|
|
|
|
|
|
|
|
|
// Stop all torrents
|
|
|
|
// Stop all torrents
|
|
|
|
makeRtorrentCall(log, "d.multicall2", new String[]{"", "main", "d.stop="}); |
|
|
|
makeRtorrentCall(log, "d.multicall2", new String[]{"", "main", "d.stop=", "d.close="}); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
|
|
|
|
|
|
|
|
case Start: |
|
|
|
case Start: |
|
|
|
|
|
|
|
|
|
|
|
// Start a torrent
|
|
|
|
// Start a torrent
|
|
|
|
|
|
|
|
makeRtorrentCall(log, "d.open", new String[]{task.getTargetTorrent().getUniqueID()}); |
|
|
|
makeRtorrentCall(log, "d.start", new String[]{task.getTargetTorrent().getUniqueID()}); |
|
|
|
makeRtorrentCall(log, "d.start", new String[]{task.getTargetTorrent().getUniqueID()}); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
|
|
|
|
|
|
|
|
case StartAll: |
|
|
|
case StartAll: |
|
|
|
|
|
|
|
|
|
|
|
// Start all torrents
|
|
|
|
// Start all torrents
|
|
|
|
makeRtorrentCall(log, "d.multicall2", new String[]{"", "main", "d.start="}); |
|
|
|
makeRtorrentCall(log, "d.multicall2", new String[]{"", "main", "d.open=", "d.start="}); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
return new DaemonTaskSuccessResult(task); |
|
|
|
|
|
|
|
|
|
|
|
case SetFilePriorities: |
|
|
|
case SetFilePriorities: |
|
|
|