When DownloadStatus is finished, it calls ProgressDisplay.stop(), which in turn calls ProgressDisplay._print_summary()
Here, in _print_summary(), we incorrectly assume that task.completed means observed steps, but in fact, when the download finishes, it is equal to task.total, which leads to issue with incorrect average download speed - no matter where we resume the download process, we always get task.total steps
Solution
Extend the ProgressDisplay class by adding a resumed_at attribute to keep track of the progress that has already been done.
Change the ProgressDisplay.stop() method to pass task.completed - self.resumed_at instead of task.completed
Problem
When
DownloadStatus
is finished, it callsProgressDisplay.stop()
, which in turn callsProgressDisplay._print_summary()
Here, in
_print_summary()
, we incorrectly assume thattask.completed
means observed steps, but in fact, when the download finishes, it is equal totask.total
, which leads to issue with incorrect average download speed - no matter where we resume the download process, we always gettask.total
stepsSolution
ProgressDisplay
class by adding aresumed_at
attribute to keep track of the progress that has already been done.ProgressDisplay.stop()
method to passtask.completed - self.resumed_at
instead oftask.completed
Related
Solves the issue #1516