mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 23:18:40 +00:00
[WebUI] Fixed ETA sorting in WebUI
When sorting the according to ETA values, all torrents with infinite value were being considered a lower value (INF -> 12 -> 32) instead of largest (12 -> 32 -> INF). This is due to the fact that the INF symbol is placed to lower value (<= 0). Now the lower values are being treated as the largest JS number when sorting. Closes: https://dev.deluge-torrent.org/ticket/3413 Closes: https://github.com/deluge-torrent/deluge/pull/321
This commit is contained in:
parent
a2d0cb7141
commit
3b11613cc7
1 changed files with 6 additions and 2 deletions
|
@ -67,7 +67,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function etaSorter(eta) {
|
function etaSorter(eta) {
|
||||||
return eta * -1;
|
if (eta === 0) return Number.MAX_VALUE;
|
||||||
|
if (eta <= -1) return Number.MAX_SAFE_INTEGER;
|
||||||
|
return eta;
|
||||||
}
|
}
|
||||||
|
|
||||||
function dateOrNever(date) {
|
function dateOrNever(date) {
|
||||||
|
@ -75,7 +77,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function timeOrInf(time) {
|
function timeOrInf(time) {
|
||||||
return time < 0 ? '∞' : ftime(time);
|
if (time === 0) return '';
|
||||||
|
if (time <= -1) return '∞';
|
||||||
|
return ftime(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue