删除未下载完成的任务时,只同时尝试删除已有下载进度的本地文件(#849)

This commit is contained in:
lyswhut
2022-05-17 10:07:34 +08:00
parent 0d1e2c3349
commit bfe7f24a4b
2 changed files with 5 additions and 2 deletions
+4 -2
View File
@@ -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(_ => _)
}
}