mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-06 05:38:44 +08:00
Fix speed is null
This commit is contained in:
@@ -157,7 +157,7 @@ class DownloadManager {
|
||||
const now = Date.now();
|
||||
this.#progress.downloaded_bytes += num;
|
||||
d.downloaded = downloaded;
|
||||
d.speed = num / (now - d.last_updated);
|
||||
d.speed = now == d.last_updated ? 0 : num / (now - d.last_updated);
|
||||
d.last_updated = now;
|
||||
}
|
||||
this.#sendEvent();
|
||||
|
||||
Reference in New Issue
Block a user