feat: 添加版本字符常量以优化歌曲匹配机制
This commit is contained in:
@@ -6,6 +6,7 @@ import mg from './mg/index'
|
||||
import bd from './bd/index'
|
||||
import xm from './xm'
|
||||
import { supportQuality } from './api-source'
|
||||
import { versionChars } from './versionChars'
|
||||
|
||||
|
||||
const sources = {
|
||||
@@ -114,8 +115,14 @@ export default {
|
||||
const fSinger = filterStr(sortSingle(singer)).toLowerCase()
|
||||
const fAlbumName = filterStr(albumName).toLowerCase()
|
||||
const fInterval = getIntv(interval)
|
||||
const isEqualsInterval = (intv) => Math.abs((fInterval || intv) - (intv || fInterval)) < 5
|
||||
const isIncludesName = (name) => (fMusicName.includes(name) || name.includes(fMusicName))
|
||||
const isEqualsInterval = (intv) => Math.abs((fInterval || intv) - (intv || fInterval)) <= 5
|
||||
const isEqualsVersionMusicNameChar = (name) => {
|
||||
for (const char of versionChars) {
|
||||
if (name.includes(char) != fMusicName.includes(char)) return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
const isIncludesName = (name) => (fMusicName.includes(name) || name.includes(fMusicName)) && isEqualsVersionMusicNameChar(name)
|
||||
const isIncludesSinger = (singer) => fSinger ? (fSinger.includes(singer) || singer.includes(fSinger)) : true
|
||||
const isEqualsAlbum = (album) => fAlbumName ? fAlbumName == album : true
|
||||
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
export const versionChars = [
|
||||
// 伴奏 / 无人声
|
||||
// instrumental: [
|
||||
'instrumental',
|
||||
'inst',
|
||||
'karaoke',
|
||||
'backing track',
|
||||
'minus one',
|
||||
'minus vocal',
|
||||
'no vocal',
|
||||
'off vocal',
|
||||
'vocal removed',
|
||||
'伴奏',
|
||||
'伴唱',
|
||||
'卡拉ok',
|
||||
'纯音乐',
|
||||
'无人声',
|
||||
'去人声',
|
||||
'消音',
|
||||
'オフボーカル',
|
||||
'インスト',
|
||||
'반주',
|
||||
'노래방',
|
||||
// ],
|
||||
|
||||
// 现场
|
||||
// live: [
|
||||
'live',
|
||||
'concert',
|
||||
'tour',
|
||||
'festival',
|
||||
'stage',
|
||||
'session',
|
||||
'现场',
|
||||
'演唱会',
|
||||
'巡演',
|
||||
'音乐会',
|
||||
'ライブ',
|
||||
'공연',
|
||||
'라이브',
|
||||
// ],
|
||||
|
||||
// 翻唱
|
||||
// cover: [
|
||||
'cover',
|
||||
'tribute',
|
||||
'rendition',
|
||||
'remake',
|
||||
'翻唱',
|
||||
'致敬',
|
||||
'改编',
|
||||
'カバー',
|
||||
'커버',
|
||||
// ],
|
||||
|
||||
// 混音
|
||||
// remix: [
|
||||
'remix',
|
||||
'mix',
|
||||
'club',
|
||||
'dance',
|
||||
'extended',
|
||||
'house',
|
||||
'edm',
|
||||
'dj',
|
||||
'dub',
|
||||
'trap',
|
||||
'混音',
|
||||
'重混',
|
||||
'电音',
|
||||
'リミックス',
|
||||
'리믹스',
|
||||
// ],
|
||||
|
||||
// 原声 / 不插电
|
||||
// acoustic: [
|
||||
'acoustic',
|
||||
'unplugged',
|
||||
'stripped',
|
||||
'原声',
|
||||
'不插电',
|
||||
'アコースティック',
|
||||
'어쿠스틱',
|
||||
// ],
|
||||
|
||||
// Demo
|
||||
// demo: [
|
||||
'demo',
|
||||
'小样',
|
||||
'试听',
|
||||
'デモ',
|
||||
'데모',
|
||||
// ],
|
||||
|
||||
// 速度变化
|
||||
// speed: [
|
||||
'slowed',
|
||||
'slowed reverb',
|
||||
'sped up',
|
||||
'speed up',
|
||||
'nightcore',
|
||||
'慢速',
|
||||
'加速',
|
||||
'变速',
|
||||
'ナイトコア',
|
||||
// ],
|
||||
|
||||
// 特殊乐器版
|
||||
// special_instrumental: [
|
||||
'piano',
|
||||
'guitar',
|
||||
'orchestra',
|
||||
'symphony',
|
||||
'violin',
|
||||
'钢琴',
|
||||
'吉他',
|
||||
'管弦乐',
|
||||
'小提琴',
|
||||
'ピアノ',
|
||||
'ギター',
|
||||
'피아노',
|
||||
'기타',
|
||||
// ]
|
||||
]
|
||||
Reference in New Issue
Block a user