Skip to content

Commit f534e11

Browse files
committed
修复下载过程中出错重试5次都失败后不会自动开始下一个任务的Bug
1 parent 2ff0f4b commit f534e11

4 files changed

Lines changed: 9 additions & 12 deletions

File tree

publish/changeLog.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
### 优化
2-
3-
- 新增歌曲URL存储,当URL无效时才重新获取,以减少接口不稳定的影响
4-
51
### 修复
62

7-
- 修复歌曲加载无法加载时自动切换混乱的Bug
8-
- 修复移除列表最后一首歌曲时播放器不停止播放的问题
3+
- 修复下载过程中出错重试5次都失败后不会自动开始下一个任务的Bug
4+

src/renderer/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default {
5353
},
5454
defaultList: {
5555
handler(n) {
56-
console.log(n)
56+
// console.log(n)
5757
this.electronStore.set('list.defaultList', n)
5858
},
5959
deep: true,

src/renderer/components/core/Player.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export default {
296296
}
297297
if (!list.length) return this.setPlayIndex(-1)
298298
let playIndex = this.list === list ? this.playIndex : list.indexOf(this.list[this.playIndex])
299-
console.log(playIndex)
299+
// console.log(playIndex)
300300
let index
301301
switch (this.setting.player.togglePlayMethod) {
302302
case 'listLoop':

src/renderer/store/modules/download.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,13 @@ const actions = {
138138
console.log('on complate')
139139
},
140140
onError(err) {
141-
console.log(err.code, err.message)
141+
// console.log(err.code, err.message)
142142
commit('onError', downloadInfo)
143143
// console.log(tryNum[downloadInfo.key])
144-
if (++tryNum[downloadInfo.key] > 5) return
144+
if (++tryNum[downloadInfo.key] > 5) {
145+
_this.dispatch('download/startTask')
146+
return
147+
}
145148
let code
146149
if (err.message.includes('Response status was')) {
147150
code = err.message.replace(/Response status was (\d+)$/, '$1')
@@ -170,9 +173,7 @@ const actions = {
170173
console.log(err)
171174
_this.dispatch('download/startTask')
172175
})
173-
return
174176
}
175-
_this.dispatch('download/startTask')
176177
},
177178
// onStateChanged(state) {
178179
// console.log(state)

0 commit comments

Comments
 (0)