mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2026-04-05 02:16:54 +08:00
fix: lyrics.js 中的时间戳解析 (#2441)
This commit is contained in:
@@ -64,8 +64,9 @@ function parseLyric(lrc) {
|
|||||||
|
|
||||||
for (const timestamp of lyricTimestamps.matchAll(extractTimestampRegex)) {
|
for (const timestamp of lyricTimestamps.matchAll(extractTimestampRegex)) {
|
||||||
const { min, sec, ms } = timestamp.groups;
|
const { min, sec, ms } = timestamp.groups;
|
||||||
const rawTime = timestamp[0];
|
const validMs = ms?.slice(0, 2) ?? '00';
|
||||||
const time = Number(min) * 60 + Number(sec) + Number(ms ?? 0) * 0.001;
|
const rawTime = `[${min}:${sec}.${validMs}]`;
|
||||||
|
const time = Number(min) * 60 + Number(sec) + Number(validMs) * 0.01;
|
||||||
|
|
||||||
/** @type {ParsedLyric} */
|
/** @type {ParsedLyric} */
|
||||||
const parsedLyric = { rawTime, time, content: trimContent(content) };
|
const parsedLyric = { rawTime, time, content: trimContent(content) };
|
||||||
|
|||||||
Reference in New Issue
Block a user