mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-05 01:23:45 -06:00
fix: a resumed download is not counted as speed
The live line divided every byte by the run's time, a partial copy left by an earlier run included, and showed a 3 GB resume as 2.5 GB/s with nothing left.
This commit is contained in:
1 parent
cf9406ab67
commit
9e8229c07a
4 files changed
+31
-3
No files matched your search
+3
-1
@@ -347,7 +347,9 @@ class Progress:
|
||||
def _draw(self) -> None:
|
||||
share = min(self.bytes / self.total_bytes, 1.0)
|
||||
elapsed = self.elapsed()
|
||||
speed = self.bytes / elapsed if elapsed > 0 else 0
|
||||
# A resumed partial copy was on disk before the run started: counted
|
||||
# in the share, never in the speed.
|
||||
speed = self.transferred() / elapsed if elapsed > 0 else 0
|
||||
left = (self.total_bytes - self.bytes) / speed if speed > 0 else 0
|
||||
parts = [
|
||||
f"{share * 100:5.1f}%",
|
||||
|
||||
Reference in new issue
Block a user