[downloader] Fix baa6c5e
: show ETA of http download as ETA instead of total d/l time
This commit is contained in:
parent
66ab0814c4
commit
00ef748cc0
2 changed files with 2 additions and 2 deletions
|
@ -96,7 +96,7 @@ class FileDownloader(object):
|
||||||
return None
|
return None
|
||||||
return int(float(remaining) / rate)
|
return int(float(remaining) / rate)
|
||||||
start, now = (start_or_rate, now_or_remaining)
|
start, now = (start_or_rate, now_or_remaining)
|
||||||
total, current = args
|
total, current = args[:2]
|
||||||
if total is None:
|
if total is None:
|
||||||
return None
|
return None
|
||||||
if now is None:
|
if now is None:
|
||||||
|
|
|
@ -294,7 +294,7 @@ class HttpFD(FileDownloader):
|
||||||
|
|
||||||
# Progress message
|
# Progress message
|
||||||
speed = self.calc_speed(start, now, byte_counter - ctx.resume_len)
|
speed = self.calc_speed(start, now, byte_counter - ctx.resume_len)
|
||||||
eta = self.calc_eta(speed, ctx.data_len and (ctx.data_len - ctx.resume_len))
|
eta = self.calc_eta(speed, ctx.data_len and (ctx.data_len - byte_counter))
|
||||||
|
|
||||||
self._hook_progress({
|
self._hook_progress({
|
||||||
'status': 'downloading',
|
'status': 'downloading',
|
||||||
|
|
Loading…
Reference in a new issue