mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 11:21:46 +00:00
fix(synced-lyrics): Fix 2 issues (#2441)
This commit is contained in:
@ -38,7 +38,7 @@ export const extractTimeAndText = (
|
||||
index,
|
||||
timeInMs,
|
||||
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',
|
||||
duration: 0,
|
||||
};
|
||||
@ -178,8 +178,8 @@ export const getLyricsList = async (
|
||||
// Add a blank line at the beginning
|
||||
raw.unshift('[0:0.0] ');
|
||||
|
||||
const syncedLyricList = raw.reduce<LineLyrics[]>((acc, line, index) => {
|
||||
const syncedLine = extractTimeAndText(line, index);
|
||||
const syncedLyricList = raw.reduce<LineLyrics[]>((acc, line) => {
|
||||
const syncedLine = extractTimeAndText(line, acc.length);
|
||||
if (syncedLine) {
|
||||
acc.push(syncedLine);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user