Changeset 12797


Ignore:
Timestamp:
Aug 30, 2011, 2:49:01 AM (10 years ago)
Author:
jordan
Message:

(trunk web) #4452 "file list not refreshing" -- instead of only requesting file info for the inspector when the inspector is opened (and also when torrent selection changes while the inspector is open), keep re-requesting the file info util we've got it. That way if the first request fails, we'll pick it up on subsequent updates.

Location:
trunk/web/javascript
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/javascript/torrent.js

    r12780 r12797  
    237237
    238238        // derived accessors
     239        hasExtraInfo: function() { return 'hashString' in this.fields; },
    239240        isSeeding: function() { return this.getStatus() === Torrent._StatusSeed; },
    240241        isStopped: function() { return this.getStatus() === Torrent._StatusStopped; },
  • trunk/web/javascript/transmission.js

    r12796 r12797  
    449449        {
    450450                if (this[Prefs._ShowInspector])
    451                         this.refreshInspectorTorrents(true);
     451                        this.refreshInspectorTorrents();
    452452
    453453                this.updateButtonStates();
     
    10771077        },
    10781078
    1079         refreshInspectorTorrents: function(full)
     1079        needsExtraInfo: function(ids)
     1080        {
     1081                var i, id, tor;
     1082
     1083                for (i=0; id=ids[i]; ++i)
     1084                        if ((tor = this._torrents[id]))
     1085                                if (!tor.hasExtraInfo())
     1086                                        return true;
     1087
     1088                return false;
     1089        },
     1090
     1091    refreshInspectorTorrents: function(full)
    10801092        {
    10811093                // some torrent fields are only used by the inspector, so we defer loading them
     
    10851097                        if (ids && ids.length) {
    10861098                                var fields = ['id'].concat(Torrent.Fields.StatsExtra);
    1087                                 if (full)
     1099                                if (this.needsExtraInfo(ids))
    10881100                                        fields = fields.concat(Torrent.Fields.InfoExtra);
    10891101                                this.remote.updateTorrents(ids, fields, this.updateFromTorrentGet, this);
     
    18281840                if (visible) {
    18291841                        var tr = this;
    1830                         this._periodic_inspector_refresh = setInterval(function() {tr.refreshInspectorTorrents(false);},2000);
    1831                         this.refreshInspectorTorrents(true);
     1842                        this._periodic_inspector_refresh = setInterval(function() {tr.refreshInspectorTorrents();},2000);
     1843                        this.refreshInspectorTorrents();
    18321844                }
    18331845
Note: See TracChangeset for help on using the changeset viewer.