修复某些情况下获取URL失败时会意外切歌的问题

This commit is contained in:
lyswhut
2021-10-29 20:05:11 +08:00
parent 35abdc63d4
commit b27a547fb8
2 changed files with 4 additions and 20 deletions
+3
View File
@@ -634,6 +634,7 @@ export default {
audio.src = this.musicInfo.url = url
}).catch(err => {
// console.log('err', err.message)
if (targetSong !== this.targetSong || this.isPlay) return
if (err.message == requestMsg.cancelRequest) return
if (!isRetryed) return this.setUrl(targetSong, isRefresh, true)
this.status = this.statusText = err.message
@@ -676,8 +677,10 @@ export default {
})
}).catch((err) => {
console.log(err)
if (targetSong.songmid !== this.musicInfo.songmid) return
this.status = this.statusText = this.$t('core.player.lyric_error')
}).finally(() => {
if (targetSong.songmid !== this.musicInfo.songmid) return
this.handleUpdateWinLyricInfo('lyric', { lrc: this.musicInfo.lrc, tlrc: this.musicInfo.tlrc, lxlrc: this.musicInfo.lxlrc })
this.setLyric()
})