修复播放下载列表时存在失效的歌曲会导致切歌不准确的问题

This commit is contained in:
lyswhut
2021-11-13 23:29:00 +08:00
parent 3a371f8d75
commit be7b06f5c8
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -192,7 +192,7 @@ const getters = {
// listPlayIndex,
// isPlayList,
// isTempPlay,
// // musicInfo: state.playMusicInfo.musicInfo,
// musicInfo: state.playMusicInfo.musicInfo,
// })
// console.log(state.playMusicInfo)
@@ -305,7 +305,7 @@ const actions = {
})
if (!filteredList.length) return commit('setPlayMusicInfo', null)
let listPlayIndex = playInfo.listPlayIndex
let listPlayIndex = filteredList.indexOf(state.listInfo.list[playInfo.listPlayIndex])
const currentListLength = state.listInfo.list.length - 1
if (listPlayIndex == -1 && currentListLength) {
listPlayIndex = prevListPlayIndex >= currentListLength ? 0 : prevListPlayIndex + 1
@@ -380,7 +380,7 @@ const actions = {
})
if (!filteredList.length) return commit('setPlayMusicInfo', null)
let listPlayIndex = playInfo.listPlayIndex
let listPlayIndex = filteredList.indexOf(state.listInfo.list[playInfo.listPlayIndex])
const currentListLength = state.listInfo.list.length - 1
if (listPlayIndex == -1 && currentListLength) {
listPlayIndex = prevListPlayIndex > currentListLength ? currentListLength : prevListPlayIndex - 1