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 <charles@charleskerr.com>
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
This commit is contained in:
Frank Aurich 2021-10-26 00:24:20 +02:00 committed by GitHub
parent a1c5a215bf
commit c42e05b42f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 15 deletions

View File

@ -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',

View File

@ -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();