尝试修复进度为0时仍然显示下载完成的问题(#2471)
This commit is contained in:
@@ -6,6 +6,10 @@
|
|||||||
- 新增「设置 → 播放设置 → 调换翻译歌词与罗马音歌词位置」设置,默认关闭(#2451)
|
- 新增「设置 → 播放设置 → 调换翻译歌词与罗马音歌词位置」设置,默认关闭(#2451)
|
||||||
- 新增启动参数 `-hidden`,在启动时将软件最小化到系统托盘(#2459)
|
- 新增启动参数 `-hidden`,在启动时将软件最小化到系统托盘(#2459)
|
||||||
|
|
||||||
|
### 修复
|
||||||
|
|
||||||
|
- 尝试修复进度为0时仍然显示下载完成的问题(#2471)
|
||||||
|
|
||||||
### 变更
|
### 变更
|
||||||
|
|
||||||
- 调换 翻译歌词 与 罗马音歌词的位置,若你想要恢复默认的行为,可以开启 调换翻译歌词与罗马音歌词位置 设置
|
- 调换 翻译歌词 与 罗马音歌词的位置,若你想要恢复默认的行为,可以开启 调换翻译歌词与罗马音歌词位置 设置
|
||||||
|
|||||||
@@ -230,6 +230,11 @@ class Task extends EventEmitter {
|
|||||||
__handleComplete() {
|
__handleComplete() {
|
||||||
if (this.status == STATUS.error) return
|
if (this.status == STATUS.error) return
|
||||||
this.__clearTimeout()
|
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(() => {
|
void this.__closeWriteStream().then(() => {
|
||||||
if (this.progress.downloaded == this.progress.total) {
|
if (this.progress.downloaded == this.progress.total) {
|
||||||
this.status = STATUS.completed
|
this.status = STATUS.completed
|
||||||
|
|||||||
Reference in New Issue
Block a user