mirror of
https://github.com/transmission/transmission
synced 2025-02-21 13:46:52 +00:00
(trunk web) minor tweaks to r12702 for clarity.
This commit is contained in:
parent
b36c648b31
commit
825706b823
1 changed files with 13 additions and 23 deletions
|
@ -65,16 +65,6 @@ Torrent._DynamicFields = [
|
||||||
'seedRatioMode', 'sizeWhenDone', 'status', 'trackerStats',
|
'seedRatioMode', 'sizeWhenDone', 'status', 'trackerStats',
|
||||||
'uploadedEver', 'uploadRatio', 'webseedsSendingToUs' ]
|
'uploadedEver', 'uploadRatio', 'webseedsSendingToUs' ]
|
||||||
|
|
||||||
// tracker stats fields whose values change all the time
|
|
||||||
Torrent._TrackerStatFields = [
|
|
||||||
'announce', 'announceState', 'downloadCount', 'hasAnnounced',
|
|
||||||
'hasScraped', 'host', 'isBackup', 'lastAnnouncePeerCount',
|
|
||||||
'lastAnnounceResult', 'lastAnnounceSucceeded', 'lastAnnounceTime',
|
|
||||||
'lastScrapeResult', 'lastScrapeSucceeded', 'lastScrapeTime',
|
|
||||||
'leecherCount', 'nextAnnounceTime', 'seederCount'
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
****
|
****
|
||||||
**** Methods
|
**** Methods
|
||||||
|
@ -85,8 +75,8 @@ Torrent.prototype =
|
||||||
{
|
{
|
||||||
initialize: function(controller, data)
|
initialize: function(controller, data)
|
||||||
{
|
{
|
||||||
this.fields = { }
|
this.fields = {}
|
||||||
this._files = [ ]
|
this._files = []
|
||||||
|
|
||||||
// these fields are set in the ctor and never change
|
// these fields are set in the ctor and never change
|
||||||
for(var i=0, key; key=Torrent._StaticFields[i]; ++i)
|
for(var i=0, key; key=Torrent._StaticFields[i]; ++i)
|
||||||
|
@ -102,7 +92,7 @@ Torrent.prototype =
|
||||||
result = []
|
result = []
|
||||||
for(var i=0, tracker; tracker=trackerStats[i]; ++i) {
|
for(var i=0, tracker; tracker=trackerStats[i]; ++i) {
|
||||||
tier = result[tracker.tier] || []
|
tier = result[tracker.tier] || []
|
||||||
tier[tier.length] = tracker
|
tier.push(tracker)
|
||||||
result[tracker.tier] = tier
|
result[tracker.tier] = tier
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
@ -116,7 +106,7 @@ Torrent.prototype =
|
||||||
for(var i=0, key; key=Torrent._MetaDataFields[i]; ++i) {
|
for(var i=0, key; key=Torrent._MetaDataFields[i]; ++i) {
|
||||||
if(key in data) {
|
if(key in data) {
|
||||||
f[key] = data[key]
|
f[key] = data[key]
|
||||||
if(key == 'name')
|
if(key === 'name')
|
||||||
f.collatedName = data.name.toLowerCase()
|
f.collatedName = data.name.toLowerCase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,11 +124,6 @@ Torrent.prototype =
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
fireDataChanged: function()
|
|
||||||
{
|
|
||||||
$(this).trigger('dataChanged',[])
|
|
||||||
},
|
|
||||||
|
|
||||||
refreshMetaData: function(data)
|
refreshMetaData: function(data)
|
||||||
{
|
{
|
||||||
this.initMetaData(data)
|
this.initMetaData(data)
|
||||||
|
@ -178,6 +163,11 @@ Torrent.prototype =
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
fireDataChanged: function()
|
||||||
|
{
|
||||||
|
$(this).trigger('dataChanged',[])
|
||||||
|
},
|
||||||
|
|
||||||
/****
|
/****
|
||||||
*****
|
*****
|
||||||
****/
|
****/
|
||||||
|
@ -296,10 +286,10 @@ Torrent.prototype =
|
||||||
|| this.isChecking()
|
|| this.isChecking()
|
||||||
break
|
break
|
||||||
case Prefs._FilterSeeding:
|
case Prefs._FilterSeeding:
|
||||||
pass = (s == Torrent._StatusSeed) || (s == Torrent._StatusSeedWait)
|
pass = (s === Torrent._StatusSeed) || (s === Torrent._StatusSeedWait)
|
||||||
break
|
break
|
||||||
case Prefs._FilterDownloading:
|
case Prefs._FilterDownloading:
|
||||||
pass = (s == Torrent._StatusDownload) || (s == Torrent._StatusDownloadWait)
|
pass = (s === Torrent._StatusDownload) || (s === Torrent._StatusDownloadWait)
|
||||||
break
|
break
|
||||||
case Prefs._FilterPaused:
|
case Prefs._FilterPaused:
|
||||||
pass = this.isStopped()
|
pass = this.isStopped()
|
||||||
|
@ -335,8 +325,8 @@ Torrent.compareById = function(ta, tb)
|
||||||
}
|
}
|
||||||
Torrent.compareByName = function(ta, tb)
|
Torrent.compareByName = function(ta, tb)
|
||||||
{
|
{
|
||||||
var i = ta.getCollatedName().compareTo(tb.getCollatedName())
|
return ta.getCollatedName().compareTo(tb.getCollatedName())
|
||||||
return i || Torrent.compareById(ta, tb)
|
|| Torrent.compareById(ta, tb)
|
||||||
}
|
}
|
||||||
Torrent.compareByQueue = function(ta, tb)
|
Torrent.compareByQueue = function(ta, tb)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue