mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-19 06:02:06 +00:00
fix(synced-lyrics): Fix 2 issues (#2441)
This commit is contained in:
@ -38,7 +38,7 @@ export const extractTimeAndText = (
|
|||||||
index,
|
index,
|
||||||
timeInMs,
|
timeInMs,
|
||||||
time: `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}:${millis}`,
|
time: `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}:${millis}`,
|
||||||
text: text?.trim() ?? config()!.defaultTextString,
|
text: text?.trim().length ? text?.trim() : config()!.defaultTextString,
|
||||||
status: 'upcoming',
|
status: 'upcoming',
|
||||||
duration: 0,
|
duration: 0,
|
||||||
};
|
};
|
||||||
@ -178,8 +178,8 @@ export const getLyricsList = async (
|
|||||||
// Add a blank line at the beginning
|
// Add a blank line at the beginning
|
||||||
raw.unshift('[0:0.0] ');
|
raw.unshift('[0:0.0] ');
|
||||||
|
|
||||||
const syncedLyricList = raw.reduce<LineLyrics[]>((acc, line, index) => {
|
const syncedLyricList = raw.reduce<LineLyrics[]>((acc, line) => {
|
||||||
const syncedLine = extractTimeAndText(line, index);
|
const syncedLine = extractTimeAndText(line, acc.length);
|
||||||
if (syncedLine) {
|
if (syncedLine) {
|
||||||
acc.push(syncedLine);
|
acc.push(syncedLine);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user