mirror of
https://github.com/transmission/transmission
synced 2025-03-19 02:05:32 +00:00
(trunk web) when sorting by ratio, use tr_stat.ratio rather than deriving it ourselves.
This commit is contained in:
parent
c7624b8864
commit
e0410cd17b
1 changed files with 5 additions and 3 deletions
|
@ -390,9 +390,11 @@ Torrent.compareByActivity = function(ta, tb)
|
||||||
};
|
};
|
||||||
Torrent.compareByRatio = function(ta, tb)
|
Torrent.compareByRatio = function(ta, tb)
|
||||||
{
|
{
|
||||||
var a = Math.ratio(ta.getUploadedEver(), ta.getDownloadedEver());
|
var a = ta.getUploadRatio();
|
||||||
var b = Math.ratio(tb.getUploadedEver(), tb.getDownloadedEver());
|
var b = tb.getUploadRatio();
|
||||||
return (a - b) || Torrent.compareByState(ta, tb);
|
if (a < b) return 1;
|
||||||
|
if (a > b) return -1;
|
||||||
|
return Torrent.compareByState(ta, tb);
|
||||||
};
|
};
|
||||||
Torrent.compareByProgress = function(ta, tb)
|
Torrent.compareByProgress = function(ta, tb)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue