From c42e05b42f07e201e518384a3a3b7a93561c5d89 Mon Sep 17 00:00:00 2001 From: Frank Aurich <1100101@gmail.com> Date: Tue, 26 Oct 2021 00:24:20 +0200 Subject: [PATCH] Fix: When removing one or more selected torrents without deleting their data, make sure to only send torrentIds, not full torrent objects, via RPC (#2040) Co-authored-by: Charles Kerr Co-authored-by: Mike Gelfand --- web/src/remote.js | 12 ++---------- web/src/remove-dialog.js | 6 +----- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/web/src/remote.js b/web/src/remote.js index ec46f113d..a11456126 100644 --- a/web/src/remote.js +++ b/web/src/remote.js @@ -203,18 +203,10 @@ export class Remote { ); } - removeTorrents(torrent_ids, callback, context) { - this.sendTorrentActionRequests( - 'torrent-remove', - torrent_ids, - callback, - context - ); - } - removeTorrentsAndData(torrents) { + removeTorrents(torrents, trash) { const o = { arguments: { - 'delete-local-data': true, + 'delete-local-data': trash, ids: [], }, method: 'torrent-remove', diff --git a/web/src/remove-dialog.js b/web/src/remove-dialog.js index 61d19d76a..a5b73cc1f 100644 --- a/web/src/remove-dialog.js +++ b/web/src/remove-dialog.js @@ -40,11 +40,7 @@ export class RemoveDialog extends EventTarget { _onConfirm() { const { remote, torrents, trash } = this.options; if (torrents.length > 0) { - if (trash) { - remote.removeTorrentsAndData(torrents); - } else { - remote.removeTorrents(torrents); - } + remote.removeTorrents(torrents, trash); } this.close();