过滤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
+10
View File
@@ -571,3 +571,13 @@ export const getFontSizeWithScreen = (screenWidth = window.innerWidth) => {
? 20
: screenWidth <= 2560 ? 20 : 22
}
export const deduplicationList = list => {
const ids = new Set()
return list.filter(s => {
if (ids.has(s.songmid)) return false
ids.add(s.songmid)
return true
})
}