修复下载列表无法切下一首歌的问题
parent
68e831468b
commit
fbe1ff73f1
|
@ -39,7 +39,7 @@ const filterList = async({ playedList, listInfo, savePath, commit }) => {
|
||||||
canPlayList.push(item)
|
canPlayList.push(item)
|
||||||
|
|
||||||
// 排除已播放音乐
|
// 排除已播放音乐
|
||||||
let index = filteredPlayedList.findIndex(m => (m.songmid || m.musicInfo.songmid) == item.musicInfo.songmid)
|
let index = filteredPlayedList.findIndex(m => m.songmid == item.songmid)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
filteredPlayedList.splice(index, 1)
|
filteredPlayedList.splice(index, 1)
|
||||||
continue
|
continue
|
||||||
|
@ -51,7 +51,7 @@ const filterList = async({ playedList, listInfo, savePath, commit }) => {
|
||||||
// if (!assertApiSupport(s.source)) return false
|
// if (!assertApiSupport(s.source)) return false
|
||||||
canPlayList.push(s)
|
canPlayList.push(s)
|
||||||
|
|
||||||
let index = filteredPlayedList.findIndex(m => (m.songmid || m.musicInfo.songmid) == s.songmid)
|
let index = filteredPlayedList.findIndex(m => m.songmid == s.songmid)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
filteredPlayedList.splice(index, 1)
|
filteredPlayedList.splice(index, 1)
|
||||||
return false
|
return false
|
||||||
|
@ -164,7 +164,7 @@ const getters = {
|
||||||
playIndex = window.downloadList.findIndex(m => m.key == currentKey)
|
playIndex = window.downloadList.findIndex(m => m.key == currentKey)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const currentSongmid = state.playMusicInfo.musicInfo.songmid || state.playMusicInfo.musicInfo.musicInfo.songmid
|
const currentSongmid = state.playMusicInfo.musicInfo.songmid
|
||||||
if (isPlayList) {
|
if (isPlayList) {
|
||||||
playIndex = state.listInfo.list.findIndex(m => m.songmid == currentSongmid)
|
playIndex = state.listInfo.list.findIndex(m => m.songmid == currentSongmid)
|
||||||
if (!isTempPlay) listPlayIndex = playIndex
|
if (!isTempPlay) listPlayIndex = playIndex
|
||||||
|
@ -275,16 +275,16 @@ const actions = {
|
||||||
let currentSongmid
|
let currentSongmid
|
||||||
if (state.playMusicInfo.isTempPlay) {
|
if (state.playMusicInfo.isTempPlay) {
|
||||||
const musicInfo = currentList[playInfo.listPlayIndex]
|
const musicInfo = currentList[playInfo.listPlayIndex]
|
||||||
if (musicInfo) currentSongmid = musicInfo.songmid || musicInfo.musicInfo.songmid
|
if (musicInfo) currentSongmid = musicInfo.songmid
|
||||||
} else {
|
} else {
|
||||||
currentSongmid = state.playMusicInfo.musicInfo.songmid || state.playMusicInfo.musicInfo.musicInfo.songmid
|
currentSongmid = state.playMusicInfo.musicInfo.songmid
|
||||||
}
|
}
|
||||||
// 从已播放列表移除播放列表已删除的歌曲
|
// 从已播放列表移除播放列表已删除的歌曲
|
||||||
let index
|
let index
|
||||||
for (index = state.playedList.findIndex(m => (m.musicInfo.songmid || m.musicInfo.musicInfo.songmid) === currentSongmid) - 1; index > -1; index--) {
|
for (index = state.playedList.findIndex(m => m.musicInfo.songmid === currentSongmid) - 1; index > -1; index--) {
|
||||||
const playMusicInfo = state.playedList[index]
|
const playMusicInfo = state.playedList[index]
|
||||||
const currentSongmid = playMusicInfo.musicInfo.songmid || playMusicInfo.musicInfo.musicInfo.songmid
|
const currentSongmid = playMusicInfo.musicInfo.songmid
|
||||||
if (playMusicInfo.listId == currentListId && !currentList.some(m => (m.songmid || m.musicInfo.songmid) === currentSongmid)) {
|
if (playMusicInfo.listId == currentListId && !currentList.some(m => m.songmid === currentSongmid)) {
|
||||||
commit('removePlayedList', index)
|
commit('removePlayedList', index)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -351,16 +351,16 @@ const actions = {
|
||||||
let currentSongmid
|
let currentSongmid
|
||||||
if (state.playMusicInfo.isTempPlay) {
|
if (state.playMusicInfo.isTempPlay) {
|
||||||
const musicInfo = currentList[playInfo.listPlayIndex]
|
const musicInfo = currentList[playInfo.listPlayIndex]
|
||||||
if (musicInfo) currentSongmid = musicInfo.songmid || musicInfo.musicInfo.songmid
|
if (musicInfo) currentSongmid = musicInfo.songmid
|
||||||
} else {
|
} else {
|
||||||
currentSongmid = state.playMusicInfo.musicInfo.songmid || state.playMusicInfo.musicInfo.musicInfo.songmid
|
currentSongmid = state.playMusicInfo.musicInfo.songmid
|
||||||
}
|
}
|
||||||
// 从已播放列表移除播放列表已删除的歌曲
|
// 从已播放列表移除播放列表已删除的歌曲
|
||||||
let index
|
let index
|
||||||
for (index = state.playedList.findIndex(m => (m.musicInfo.songmid || m.musicInfo.musicInfo.songmid) === currentSongmid) + 1; index < state.playedList.length; index++) {
|
for (index = state.playedList.findIndex(m => m.musicInfo.songmid === currentSongmid) + 1; index < state.playedList.length; index++) {
|
||||||
const playMusicInfo = state.playedList[index]
|
const playMusicInfo = state.playedList[index]
|
||||||
const currentSongmid = playMusicInfo.musicInfo.songmid || playMusicInfo.musicInfo.musicInfo.songmid
|
const currentSongmid = playMusicInfo.musicInfo.songmid
|
||||||
if (playMusicInfo.listId == currentListId && !currentList.some(m => (m.songmid || m.musicInfo.songmid) === currentSongmid)) {
|
if (playMusicInfo.listId == currentListId && !currentList.some(m => m.songmid === currentSongmid)) {
|
||||||
commit('removePlayedList', index)
|
commit('removePlayedList', index)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -483,8 +483,8 @@ const mutations = {
|
||||||
} else {
|
} else {
|
||||||
let listId = playMusicInfo.listId
|
let listId = playMusicInfo.listId
|
||||||
if (listId != '__temp__' && !playMusicInfo.isTempPlay && listId === state.listInfo.id) {
|
if (listId != '__temp__' && !playMusicInfo.isTempPlay && listId === state.listInfo.id) {
|
||||||
const currentSongmid = playMusicInfo.musicInfo.songmid || playMusicInfo.musicInfo.musicInfo.songmid
|
const currentSongmid = playMusicInfo.musicInfo.songmid
|
||||||
playIndex = state.listInfo.list.findIndex(m => (m.songmid || m.musicInfo.songmid) == currentSongmid)
|
playIndex = state.listInfo.list.findIndex(m => m.songmid == currentSongmid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue