From bfe7f24a4b11cd802c7149aaa3fb5ccef30f4a94 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 17 May 2022 10:07:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=9C=AA=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=9A=84=E4=BB=BB=E5=8A=A1=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E5=90=8C=E6=97=B6=E5=B0=9D=E8=AF=95=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=B7=B2=E6=9C=89=E4=B8=8B=E8=BD=BD=E8=BF=9B=E5=BA=A6=E7=9A=84?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E6=96=87=E4=BB=B6=EF=BC=88#849=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/renderer/store/modules/download.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 35e0faa5..e8399391 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -6,6 +6,7 @@ - 同时删除一首歌以上时将需要二次确认删除 - 禁用透明窗口时右侧不再偏移5px距离(在win7、Ubuntu等系统上测试发现不偏移也不影响滚动条的拖动了) +- 删除未下载完成的任务时,只同时尝试删除已有下载进度的本地文件 ### 修复 diff --git a/src/renderer/store/modules/download.js b/src/renderer/store/modules/download.js index be2d85e1..2159509e 100644 --- a/src/renderer/store/modules/download.js +++ b/src/renderer/store/modules/download.js @@ -519,7 +519,8 @@ const actions = { delete dls[item.key] } commit('removeTask', item) - if (item.status != downloadStatus.COMPLETED) { + // 没有未完成、已下载大于1k + if (item.status != downloadStatus.COMPLETED && item.progress.total && item.progress.downloaded > 1024) { try { await deleteFile(item.metadata.filePath) } catch (_) {} @@ -541,7 +542,8 @@ const actions = { delete dls[item.key] } } - if (item.status != downloadStatus.COMPLETED) { + // 没有未完成、已下载大于1k + if (item.status != downloadStatus.COMPLETED && item.progress.total && item.progress.downloaded > 1024) { deleteFile(item.metadata.filePath).catch(_ => _) } }