mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Merge pull request #1328 from glassez/webui-sort
Fix WebUI sort by size/speed (part 2)
This commit is contained in:
commit
f5cd39cfba
@ -79,8 +79,9 @@ var dynamicTable = new Class ({
|
||||
case 8: // Down Speed
|
||||
var sizeStrToFloat = function(mystr) {
|
||||
var val1 = mystr.split(' ');
|
||||
var val1num = val1[0].toFloat()
|
||||
var unit = val1[1];
|
||||
val1[0] = val1[0].replace(",", "."); // toFloat() cannot parse comma as decimal point
|
||||
var val1num = val1[0].toFloat();
|
||||
var unit = val1[1].split('/')[0]; // get an unit numerator only (to support speed values)
|
||||
switch(unit) {
|
||||
case '_(TiB)':
|
||||
return val1num*1099511627776;
|
||||
@ -111,9 +112,11 @@ var dynamicTable = new Class ({
|
||||
return (tr2.getElements('td')[i].get('html').split(' ')[0].toInt() - tr1.getElements('td')[i].get('html').split(' ')[0].toInt());
|
||||
default: // Ratio
|
||||
var ratio1 = tr1.getElements('td')[i].get('html');
|
||||
ratio1 = ratio1.replace(",", "."); // toFloat() cannot parse comma as decimal point
|
||||
if(ratio1 == '∞')
|
||||
ratio1 = '101.0';
|
||||
var ratio2 = tr2.getElements('td')[i].get('html');
|
||||
ratio2 = ratio2.replace(",", "."); // toFloat() cannot parse comma as decimal point
|
||||
if(ratio2 == '∞')
|
||||
ratio2 = '101.0';
|
||||
if(!reverseSort)
|
||||
|
Loading…
Reference in New Issue
Block a user