尝试修复进度为0时仍然显示下载完成的问题(#2471)

beta
lyswhut 2025-08-05 12:16:24 +08:00
parent 3d64ca37e7
commit 49c8081f68
2 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,10 @@
- 新增「设置 → 播放设置 → 调换翻译歌词与罗马音歌词位置」设置,默认关闭(#2451
- 新增启动参数 `-hidden`,在启动时将软件最小化到系统托盘(#2459
### 修复
- 尝试修复进度为0时仍然显示下载完成的问题#2471
### 变更
- 调换 翻译歌词 与 罗马音歌词的位置,若你想要恢复默认的行为,可以开启 调换翻译歌词与罗马音歌词位置 设置

View File

@ -230,6 +230,11 @@ class Task extends EventEmitter {
__handleComplete() {
if (this.status == STATUS.error) return
this.__clearTimeout()
if (this.progress.progress <= 0) {
this.status = STATUS.error
this.emit('error', new Error('Progress is 0, download failed.'))
return
}
void this.__closeWriteStream().then(() => {
if (this.progress.downloaded == this.progress.total) {
this.status = STATUS.completed