Skip to content

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

fix(task_card): 修正校验大文件时进度条无法显示的问题

XiaoYouChRe1e73f1dd7c1
diff --git a/app/components/task_card.py b/app/components/task_card.py
index e44e4390..9e5c6a9a 100644
--- a/app/components/task_card.py
+++ b/app/components/task_card.py
@@ -502,10 +502,10 @@ class TaskCard(CardWidget, Ui_TaskCard):
def runCalcHashTask(self, algorithm):
self.__showInfo(self.tr("正在校验 ") + algorithm + self.tr(", 请稍后..."))
self.changeButtonStatus(enabled=False)
- self.progressBar.setMaximum(Path(f"{self.filePath}/{self.fileName}").stat().st_size) # 设置进度条最大值
+ self.progressBar.setMaximum(Path(f"{self.filePath}/{self.fileName}").stat().st_size/1048576) # 设置进度条最大值
self.calcTask = CalcHashThread(f"{self.filePath}/{self.fileName}", algorithm)
- self.calcTask.calcProgress.connect(lambda x: self.progressBar.setValue(int(x)))
+ self.calcTask.calcProgress.connect(lambda x: self.progressBar.setValue(int(x)/1048576))
self.calcTask.returnHash.connect(self.whenHashCalcFinished)
self.calcTask.start()