From 2f08337a98d3b642d9cb21a7fda29f4389406f28 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 26 Feb 2022 17:19:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E6=97=A0=E6=95=88=E6=AD=8C=E6=9B=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/list/action.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/store/modules/list/action.js b/src/store/modules/list/action.js index 3cce1bd1..c154a9fb 100644 --- a/src/store/modules/list/action.js +++ b/src/store/modules/list/action.js @@ -81,6 +81,33 @@ export const initList = listData => async(dispatch, getState) => { }) if (isNeedSaveSortInfo) await saveListAllSort(listSort) + let needSaveLists = [] + const allList = [...(userList ?? [])] + if (loveList) allList.unshift(loveList) + if (defaultList) allList.unshift(defaultList) + allList.forEach(list => { + let isNeedSaveList = false + const newList = list.list.filter(musicInfo => { + // PC v1.8.2以前的Lyric + if (musicInfo.lxlrc) { + delete musicInfo.lxlrc + isNeedSaveList = true + } + if (musicInfo.lrc) { + delete musicInfo.lrc + isNeedSaveList = true + } + if (musicInfo.tlrc) { + delete musicInfo.tlrc + isNeedSaveList = true + } + + return !!musicInfo.songmid + }) + if (isNeedSaveList || newList.length != list.length) needSaveLists.push(list) + }) + if (needSaveLists.length) saveList(needSaveLists) + // console.log(userList.map(l => `${listSort[l.id]} - ${l.name}`)) dispatch({ type: TYPES.initList,