修复下载过程中出错重试5次都失败后不会自动开始下一个任务的Bug

pull/96/head
lyswhut 2019-08-21 13:18:59 +08:00
parent 2ff0f4b102
commit f534e11acb
4 changed files with 9 additions and 12 deletions

View File

@ -1,8 +1,4 @@
### 优化
- 新增歌曲URL存储当URL无效时才重新获取以减少接口不稳定的影响
### 修复 ### 修复
- 修复歌曲加载无法加载时自动切换混乱的Bug - 修复下载过程中出错重试5次都失败后不会自动开始下一个任务的Bug
- 修复移除列表最后一首歌曲时播放器不停止播放的问题

View File

@ -53,7 +53,7 @@ export default {
}, },
defaultList: { defaultList: {
handler(n) { handler(n) {
console.log(n) // console.log(n)
this.electronStore.set('list.defaultList', n) this.electronStore.set('list.defaultList', n)
}, },
deep: true, deep: true,

View File

@ -296,7 +296,7 @@ export default {
} }
if (!list.length) return this.setPlayIndex(-1) if (!list.length) return this.setPlayIndex(-1)
let playIndex = this.list === list ? this.playIndex : list.indexOf(this.list[this.playIndex]) let playIndex = this.list === list ? this.playIndex : list.indexOf(this.list[this.playIndex])
console.log(playIndex) // console.log(playIndex)
let index let index
switch (this.setting.player.togglePlayMethod) { switch (this.setting.player.togglePlayMethod) {
case 'listLoop': case 'listLoop':

View File

@ -138,10 +138,13 @@ const actions = {
console.log('on complate') console.log('on complate')
}, },
onError(err) { onError(err) {
console.log(err.code, err.message) // console.log(err.code, err.message)
commit('onError', downloadInfo) commit('onError', downloadInfo)
// console.log(tryNum[downloadInfo.key]) // console.log(tryNum[downloadInfo.key])
if (++tryNum[downloadInfo.key] > 5) return if (++tryNum[downloadInfo.key] > 5) {
_this.dispatch('download/startTask')
return
}
let code let code
if (err.message.includes('Response status was')) { if (err.message.includes('Response status was')) {
code = err.message.replace(/Response status was (\d+)$/, '$1') code = err.message.replace(/Response status was (\d+)$/, '$1')
@ -170,9 +173,7 @@ const actions = {
console.log(err) console.log(err)
_this.dispatch('download/startTask') _this.dispatch('download/startTask')
}) })
return
} }
_this.dispatch('download/startTask')
}, },
// onStateChanged(state) { // onStateChanged(state) {
// console.log(state) // console.log(state)