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

pull/930/merge
lyswhut 2022-05-17 10:07:34 +08:00
parent 0d1e2c3349
commit bfe7f24a4b
2 changed files with 5 additions and 2 deletions

View File

@ -6,6 +6,7 @@
- 同时删除一首歌以上时将需要二次确认删除
- 禁用透明窗口时右侧不再偏移5px距离在win7、Ubuntu等系统上测试发现不偏移也不影响滚动条的拖动了
- 删除未下载完成的任务时,只同时尝试删除已有下载进度的本地文件
### 修复

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(_ => _)
}
}