From 7b755a9596a527382b48a9aba81d18dfb3326785 Mon Sep 17 00:00:00 2001 From: Kevin Glowacz Date: Tue, 30 Jun 2009 03:37:40 +0000 Subject: [PATCH] (trunk web) refresh all of the torrent's data when change a file --- web/javascript/transmission.js | 11 +++++++---- web/javascript/transmission.remote.js | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/web/javascript/transmission.js b/web/javascript/transmission.js index 396719b27..1b0372eab 100644 --- a/web/javascript/transmission.js +++ b/web/javascript/transmission.js @@ -1146,16 +1146,19 @@ Transmission.prototype = this.setFilter( Prefs._FilterAll ); }, - refreshTorrents: function() { + refreshTorrents: function(ids) { 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 new_torrent_ids = []; var refresh_files_for = []; - jQuery.each( active, function() { + jQuery.each( updated, function() { var t = tr._torrents[this.id]; if (t){ t.refresh(this); diff --git a/web/javascript/transmission.remote.js b/web/javascript/transmission.remote.js index a3de1fa11..2dd9511f2 100644 --- a/web/javascript/transmission.remote.js +++ b/web/javascript/transmission.remote.js @@ -154,7 +154,7 @@ TransmissionRemote.prototype = }; o.arguments[command] = [ file._index ]; this.sendRequest( o, function( ) { - remote.loadTorrentFiles( torrent_ids ); + remote._controller.refreshTorrents( torrent_ids ); } ); },