过滤id重复的歌曲

This commit is contained in:
lyswhut
2022-03-19 16:25:28 +08:00
parent 798b840472
commit 4d7d92759f
4 changed files with 24 additions and 4 deletions
+4 -1
View File
@@ -1,5 +1,6 @@
import music from '../../utils/music'
import { markRawList } from '@renderer/utils/vueTools'
import { deduplicationList } from '@renderer/utils'
const sources = []
const sourceList = {}
@@ -85,7 +86,7 @@ sources.push({
})
// state
const state = {
const state = window.state = {
sourceList,
list: [],
text: '',
@@ -151,6 +152,7 @@ const mutations = {
},
setList(state, datas) {
let source = state.sourceList[datas.source]
datas.list = deduplicationList(datas.list)
source.list = markRawList(datas.list)
source.total = datas.total
source.allPage = datas.allPage
@@ -170,6 +172,7 @@ const mutations = {
total += source.total
// limit = Math.max(source.limit, limit)
}
list = deduplicationList(list)
state.allPage = Math.max(...pages)
state.total = total
state.limit = limit