Display average download speed in place of instantaneous speed

This commit is contained in:
alessandro90
2019-06-28 22:33:08 +02:00
parent 9ebf75c0fb
commit 88343af009

View File

@@ -87,8 +87,8 @@ class DownloadThread(BaseDownloadThread):
preload_content=False,
timeout=4.0
)
while True:
start = perf_counter()
while True:
try:
data = self._db.read(self._CHUNK)
except Exception:
@@ -100,7 +100,7 @@ class DownloadThread(BaseDownloadThread):
raw_data += data
self.progress.emit(
self._pretty_len(raw_data),
self._get_download_speed(data, delta)
self._get_download_speed(raw_data, delta)
)
if self._exit_call:
self._exit_call = False