gremlin/gremlin.in: Don't report zero seconds left until we're done.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 17 Apr 2018 01:11:17 +0000 (02:11 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 19 Apr 2018 11:22:49 +0000 (12:22 +0100)
gremlin/gremlin.in

index af4da27..cca2789 100644 (file)
@@ -41,7 +41,7 @@ import shutil as SH
 import optparse as OP
 import threading as TH
 import shlex as L
-from math import sqrt
+from math import sqrt, ceil
 from contextlib import contextmanager
 
 ## eyeD3 tag fettling.
@@ -247,7 +247,7 @@ class ProgressEyecandy (object):
     ## Work out -- well, guess -- the time remaining.
     if cur:
       t = T.time()
-      eta = me._fmt_time((t - me._start)*(max - cur)/cur)
+      eta = me._fmt_time(ceil((t - me._start)*(max - cur)/cur))
     else:
       eta = '???'