Merge pull request #146 from tonsV2/master

ETA is now shown in compact view.
This commit is contained in:
Mike Gelfand 2017-05-21 07:24:59 +03:00 committed by GitHub
commit 4df187885f
1 changed files with 11 additions and 0 deletions

View File

@ -107,6 +107,14 @@ TorrentRendererHelper.formatDL = function (t) {
return '↓ ' + Transmission.fmt.speedBps(t.getDownloadSpeed());
};
TorrentRendererHelper.formatETA = function(t) {
var eta = t.getETA();
if (eta < 0 || eta >= (999 * 60 * 60)) {
return "";
};
return "ETA: " + Transmission.fmt.timeInterval(eta);
};
/****
*****
*****
@ -328,6 +336,9 @@ TorrentRendererCompact.prototype = {
return 'Idle';
};
var s = '';
if (!isMobileDevice) {
s = TorrentRendererHelper.formatETA(t) + ' ';
};
if (have_dn) {
s += TorrentRendererHelper.formatDL(t);
};