1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-11 22:52:53 +00:00

(trunk web) refresh all of the torrent's data when change a file

This commit is contained in:
Kevin Glowacz 2009-06-30 03:37:40 +00:00
parent c7d3eabf40
commit 7b755a9596
2 changed files with 8 additions and 5 deletions

View file

@ -1146,16 +1146,19 @@ Transmission.prototype =
this.setFilter( Prefs._FilterAll ); this.setFilter( Prefs._FilterAll );
}, },
refreshTorrents: function() { refreshTorrents: function(ids) {
var tr = this; var tr = this;
this.remote.getUpdatedDataFor('recently-active', function(active, removed){ tr.updateTorrentsData(active, removed); }); if (!ids)
ids = 'recently-active';
this.remote.getUpdatedDataFor(ids, function(active, removed){ tr.updateTorrentsData(active, removed); });
}, },
updateTorrentsData: function( active, removed_ids ) { updateTorrentsData: function( updated, removed_ids ) {
var tr = this; var tr = this;
var new_torrent_ids = []; var new_torrent_ids = [];
var refresh_files_for = []; var refresh_files_for = [];
jQuery.each( active, function() { jQuery.each( updated, function() {
var t = tr._torrents[this.id]; var t = tr._torrents[this.id];
if (t){ if (t){
t.refresh(this); t.refresh(this);

View file

@ -154,7 +154,7 @@ TransmissionRemote.prototype =
}; };
o.arguments[command] = [ file._index ]; o.arguments[command] = [ file._index ];
this.sendRequest( o, function( ) { this.sendRequest( o, function( ) {
remote.loadTorrentFiles( torrent_ids ); remote._controller.refreshTorrents( torrent_ids );
} ); } );
}, },