修复扩展歌词匹配问题
parent
b9ac754c07
commit
8ecd6e6f54
|
@ -24,7 +24,7 @@ const parseExtendedLyric = (lrcLinesMap, extendedLyric) => {
|
||||||
const times = timeField.match(timeExp)
|
const times = timeField.match(timeExp)
|
||||||
if (times == null) continue
|
if (times == null) continue
|
||||||
for (const time of times) {
|
for (const time of times) {
|
||||||
const timeStr = time.replace(/(\.\d\d)0$/, '$1')
|
const timeStr = time.replace(/(?:\.0+|0+)$/, '')
|
||||||
const targetLine = lrcLinesMap[timeStr]
|
const targetLine = lrcLinesMap[timeStr]
|
||||||
if (targetLine) targetLine.extendedLyrics.push(text)
|
if (targetLine) targetLine.extendedLyrics.push(text)
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ module.exports = class LinePlayer {
|
||||||
const times = timeField.match(timeExp)
|
const times = timeField.match(timeExp)
|
||||||
if (times == null) continue
|
if (times == null) continue
|
||||||
for (const time of times) {
|
for (const time of times) {
|
||||||
const timeStr = time.replace(/(\.\d\d)0$/, '$1')
|
const timeStr = time.replace(/(?:\.0+|0+)$/, '')
|
||||||
if (linesMap[timeStr]) {
|
if (linesMap[timeStr]) {
|
||||||
linesMap[timeStr].extendedLyrics.push(text)
|
linesMap[timeStr].extendedLyrics.push(text)
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue