We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4f0c00 commit 729761dCopy full SHA for 729761d
1 file changed
src/utils/lyrics.js
@@ -64,8 +64,9 @@ function parseLyric(lrc) {
64
65
for (const timestamp of lyricTimestamps.matchAll(extractTimestampRegex)) {
66
const { min, sec, ms } = timestamp.groups;
67
- const rawTime = timestamp[0];
68
- const time = Number(min) * 60 + Number(sec) + Number(ms ?? 0) * 0.001;
+ const validMs = ms?.slice(0, 2) ?? '00';
+ const rawTime = `[${min}:${sec}.${validMs}]`;
69
+ const time = Number(min) * 60 + Number(sec) + Number(validMs) * 0.01;
70
71
/** @type {ParsedLyric} */
72
const parsedLyric = { rawTime, time, content: trimContent(content) };
0 commit comments