mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 04:18:39 +00:00
(trunk web) refactor sendTorrentCommand in my quest to allow remote.js to stand on its own
This also happens to fix #2322. Before, the callback would only update recently-active torrents. Now it updates all affected torrents.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user