From 478b71172d87f282dd066bd731eedf5eec4dec8b Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sun, 20 Mar 2022 12:53:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=87=E6=AD=8C=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/store/modules/player.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/store/modules/player.js b/src/renderer/store/modules/player.js index 1b4d88d3..86d3418e 100644 --- a/src/renderer/store/modules/player.js +++ b/src/renderer/store/modules/player.js @@ -322,7 +322,7 @@ const actions = { playMusic() }, async playNext({ state, rootState, commit, getters }, { findNum = 0, excludeList = [] } = {}) { - if (tempPlayList.length) { + if (tempPlayList.length) { // 如果稍后播放列表存在歌曲则直接播放改列表的歌曲 const playMusicInfo = tempPlayList[0] commit('removeTempPlayList', 0) commit('setPlayMusicInfo', playMusicInfo) @@ -334,7 +334,7 @@ const actions = { const currentListId = playInfo.playListId const currentList = getList(currentListId) - if (playedList.length) { + if (playedList.length) { // 移除已播放列表内不存在原列表的歌曲 let currentSongmid if (playMusicInfo.isTempPlay) { const musicInfo = currentList[playInfo.listPlayIndex] @@ -360,8 +360,8 @@ const actions = { return } } - const isCheckFile = findNum > 2 - let filteredList = await filterList({ + const isCheckFile = findNum > 2 // 针对下载列表,如果超过两次都碰到无效歌曲,则过滤整个列表内的无效歌曲 + let filteredList = await filterList({ // 过滤已播放歌曲 listInfo: { id: currentListId, list: currentList }, playedList: excludeList.length ? [...playedList, ...excludeList] : playedList, savePath: rootState.setting.download.savePath, @@ -396,7 +396,7 @@ const actions = { musicInfo: filteredList[nextIndex], listId: currentListId, } - if (currentListId == 'download' && !isCheckFile) { + if (currentListId == 'download' && !isCheckFile) { // 针对下载列表,检查文件是否可以播放 if (!await checkPath(path.join(rootState.setting.download.savePath, nextPlayMusicInfo.musicInfo.metadata.fileName)) || !nextPlayMusicInfo.musicInfo.isComplate || /\.ape$/.test(nextPlayMusicInfo.musicInfo.metadata.fileName)) { excludeList.push(nextPlayMusicInfo) // console.log('findNum', findNum)