跳过空白歌词

This commit is contained in:
lyswhut
2022-04-10 22:25:25 +08:00
parent 1c542a9b17
commit e75863e99d
3 changed files with 8 additions and 7 deletions
+2 -1
View File
@@ -91,6 +91,7 @@ const buildParams = (id, isGetLyricx) => {
// console.log(buildParams('207527604', true))
const timeExp = /^\[([\d:.]*)\]{1}/g
const existTimeExp = /\[\d{1,2}:.*\d{1,4}\]/
export default {
sortLrcArr(arr) {
const lrcSet = new Set()
@@ -201,7 +202,7 @@ export default {
lrcInfo.lxlyric = ''
}
lrcInfo.lyric = lrcInfo.lyric.replace(lrcTools.rxps.wordTimeAll, '')
if (!lrcInfo.lyric.trim()) return Promise.reject(new Error('Get lyric failed'))
if (!existTimeExp.test(lrcInfo.lyric)) return Promise.reject(new Error('Get lyric failed'))
// console.log(lrcInfo)
return lrcInfo
})