diff --git a/web/javascript/transmission.js b/web/javascript/transmission.js index 8c41b9e16..af52ba6e5 100644 --- a/web/javascript/transmission.js +++ b/web/javascript/transmission.js @@ -1381,7 +1381,9 @@ Transmission.prototype = }, removeTorrents: function( torrents ) { - this.remote.removeTorrents( torrents ); + var torrent_ids = jQuery.map(torrents, function(t) { return t.id(); } ); + var tr = this; + this.remote.removeTorrents( torrent_ids, function(){ tr.refreshTorrents() } ); }, removeTorrentsAndData: function( torrents ) { @@ -1402,13 +1404,17 @@ Transmission.prototype = this.startTorrents( [ torrent ] ); }, startTorrents: function( torrents ) { - this.remote.startTorrents( torrents ); + var torrent_ids = jQuery.map(torrents, function(t) { return t.id(); } ); + var tr = this; + this.remote.startTorrents( torrent_ids, function(){ tr.refreshTorrents(torrent_ids) } ); }, verifyTorrent: function( torrent ) { this.verifyTorrents( [ torrent ] ); }, verifyTorrents: function( torrents ) { - this.remote.verifyTorrents( torrents ); + var torrent_ids = jQuery.map(torrents, function(t) { return t.id(); } ); + var tr = this; + this.remote.verifyTorrents( torrent_ids, function(){ tr.refreshTorrents(torrent_ids) } ); }, stopSelectedTorrents: function( ) { @@ -1421,7 +1427,9 @@ Transmission.prototype = this.stopTorrents( [ torrent ] ); }, stopTorrents: function( torrents ) { - this.remote.stopTorrents( torrents ); + var torrent_ids = jQuery.map(torrents, function(t) { return t.id(); } ); + var tr = this; + this.remote.stopTorrents( torrent_ids, function(){ tr.refreshTorrents(torrent_ids )} ); }, changeFileCommand: function(command, torrent, file) { this.remote.changeFileCommand(command, torrent, file) diff --git a/web/javascript/transmission.remote.js b/web/javascript/transmission.remote.js index 733987537..e9a3d6b6e 100644 --- a/web/javascript/transmission.remote.js +++ b/web/javascript/transmission.remote.js @@ -146,28 +146,25 @@ TransmissionRemote.prototype = } ); }, - sendTorrentCommand: function( method, torrents ) { - var remote = this; + sendTorrentActionRequests: function( method, torrent_ids, callback ) { var o = { method: method, - arguments: { ids: [ ] } + arguments: { ids: torrent_ids } }; - if( torrents != null ) - for( var i=0, len=torrents.length; i