Skip to content

The only downloader you need. 下载器的集大成者。

Revert "fix: 修复任务恢复时速度不正确"

XiaoYouChRcffa05237c4f
diff --git a/app/common/download_task.py b/app/common/download_task.py
index e0b6f12a..a4a1beb5 100644
--- a/app/common/download_task.py
+++ b/app/common/download_task.py
@@ -223,7 +223,7 @@ class DownloadTask(QThread):
self.downloadStrategy = None
# Speed tracking
- self.historyProgress = deque(maxlen = 10) # Rolling window of 10 seconds for speed calculation
+ self.historyProgress = deque([self.progress] * 10) # Rolling window of 10 seconds for speed calculation
# HTTP client setup
proxy = getProxy()
@@ -720,12 +720,6 @@ class DownloadTask(QThread):
# Load or create workers
self.__loadWorkers()
- # Calculate total progress
- self.progress = 0
- for worker in self.workers:
- self.progress += worker.progress - worker.startPos
- self.historyProgress = deque([self.progress] * 10, maxlen = 10)
-
# Create and configure event loop
if sys.platform == "win32":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())