mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-05 21:58:56 +08:00
初始化时过滤无效歌曲
This commit is contained in:
parent
d344dbe2e4
commit
2f08337a98
@ -81,6 +81,33 @@ export const initList = listData => async(dispatch, getState) => {
|
|||||||
})
|
})
|
||||||
if (isNeedSaveSortInfo) await saveListAllSort(listSort)
|
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}`))
|
// console.log(userList.map(l => `${listSort[l.id]} - ${l.name}`))
|
||||||
dispatch({
|
dispatch({
|
||||||
type: TYPES.initList,
|
type: TYPES.initList,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user