summaryrefslogtreecommitdiffstats
path: root/deluge/ui/web
diff options
context:
space:
mode:
authorCalum Lind <calumlind@gmail.com>2018-10-19 17:28:31 +0100
committerCalum Lind <calumlind@gmail.com>2018-10-19 17:30:27 +0100
commitd85f665091e01f585beae3332404086480eb7005 (patch)
tree569b34e7051e711f88bdb5039ecdc2625d2a7bab /deluge/ui/web
parent5ec6ae3ad0b5f61711448b62e992a77c7ac4857f (diff)
downloaddeluge-d85f665091e01f585beae3332404086480eb7005.tar.gz
deluge-d85f665091e01f585beae3332404086480eb7005.tar.bz2
deluge-d85f665091e01f585beae3332404086480eb7005.zip
Fix large ETA overflow C int
The following error was encountered in GTK3 which is a result of trying to cast a very large ETA value to C int and raising an Overlflow error. <type 'exceptions.OverflowError'>: 3072227291 not in range -2147483648 to 2147483647 The solution is to limit the ETA to 1 year and represent any values over that as -1 which the UIs can display as infinity.
Diffstat (limited to 'deluge/ui/web')
-rw-r--r--deluge/ui/web/js/deluge-all/TorrentGrid.js6
-rw-r--r--deluge/ui/web/js/deluge-all/details/StatusTab.js2
2 files changed, 6 insertions, 2 deletions
diff --git a/deluge/ui/web/js/deluge-all/TorrentGrid.js b/deluge/ui/web/js/deluge-all/TorrentGrid.js
index c6559d443..b0e0c5ec7 100644
--- a/deluge/ui/web/js/deluge-all/TorrentGrid.js
+++ b/deluge/ui/web/js/deluge-all/TorrentGrid.js
@@ -74,6 +74,10 @@
return date > 0.0 ? fdate(date) : _('Never');
}
+ function timeOrInf(time) {
+ return time < 0 ? '&infin;' : ftime(time);
+ }
+
/**
* Deluge.TorrentGrid Class
*
@@ -154,7 +158,7 @@
header: _('ETA'),
width: 60,
sortable: true,
- renderer: ftime,
+ renderer: timeOrInf,
dataIndex: 'eta',
},
{
diff --git a/deluge/ui/web/js/deluge-all/details/StatusTab.js b/deluge/ui/web/js/deluge-all/details/StatusTab.js
index 864afce1c..a8753bb87 100644
--- a/deluge/ui/web/js/deluge-all/details/StatusTab.js
+++ b/deluge/ui/web/js/deluge-all/details/StatusTab.js
@@ -102,7 +102,7 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, {
upspeed: status.upload_payload_rate
? fspeed(status.upload_payload_rate)
: '0.0 KiB/s',
- eta: ftime(status.eta),
+ eta: status.eta < 0 ? '&infin;' : ftime(status.eta),
pieces: status.num_pieces + ' (' + fsize(status.piece_length) + ')',
seeds: seeds,
peers: peers,