Display average download speed in place of instantaneous speed
This commit is contained in:
@@ -87,8 +87,8 @@ class DownloadThread(BaseDownloadThread):
|
|||||||
preload_content=False,
|
preload_content=False,
|
||||||
timeout=4.0
|
timeout=4.0
|
||||||
)
|
)
|
||||||
while True:
|
|
||||||
start = perf_counter()
|
start = perf_counter()
|
||||||
|
while True:
|
||||||
try:
|
try:
|
||||||
data = self._db.read(self._CHUNK)
|
data = self._db.read(self._CHUNK)
|
||||||
except Exception:
|
except Exception:
|
||||||
@@ -100,7 +100,7 @@ class DownloadThread(BaseDownloadThread):
|
|||||||
raw_data += data
|
raw_data += data
|
||||||
self.progress.emit(
|
self.progress.emit(
|
||||||
self._pretty_len(raw_data),
|
self._pretty_len(raw_data),
|
||||||
self._get_download_speed(data, delta)
|
self._get_download_speed(raw_data, delta)
|
||||||
)
|
)
|
||||||
if self._exit_call:
|
if self._exit_call:
|
||||||
self._exit_call = False
|
self._exit_call = False
|
||||||
|
|||||||
Reference in New Issue
Block a user