优化播放歌曲换源匹配规则

pull/453/head
lyswhut 2021-01-18 16:28:11 +08:00
parent 1af3cd1d77
commit e8dba4d133
1 changed files with 6 additions and 1 deletions

View File

@ -70,7 +70,8 @@ export default {
arr.splice(i, 1) arr.splice(i, 1)
} }
} }
return tempResult.reverse() tempResult.reverse()
return tempResult
} }
const trimStr = str => typeof str == 'string' ? str.trim() : str const trimStr = str => typeof str == 'string' ? str.trim() : str
const sortedSinger = sortSingle(musicInfo.singer) const sortedSinger = sortSingle(musicInfo.singer)
@ -90,6 +91,10 @@ export default {
( (
item.interval === musicInfo.interval && item.name === musicName && item.interval === musicInfo.interval && item.name === musicName &&
(item.sortedSinger.includes(sortedSinger) || sortedSinger.includes(item.sortedSinger)) (item.sortedSinger.includes(sortedSinger) || sortedSinger.includes(item.sortedSinger))
) ||
(
item.name === musicName && item.albumName === musicInfo.albumName &&
item.interval === musicInfo.interval
) )
) { ) {
return item return item