Skip to content

feat(lyrics): support LRC timestamps exceeding one hour - #2778

Open
GeorgeClensy wants to merge 1 commit into
PixelPlayerHQ:masterfrom
GeorgeClensy:feat/lyrics-long-duration
Open

feat(lyrics): support LRC timestamps exceeding one hour#2778
GeorgeClensy wants to merge 1 commit into
PixelPlayerHQ:masterfrom
GeorgeClensy:feat/lyrics-long-duration

Conversation

@GeorgeClensy

Copy link
Copy Markdown

Updated the lyrics utility to correctly parse and format LRC timestamps for tracks longer than 60 minutes.

  • Updated LRC_LINE_REGEX, LRC_WORD_REGEX, and related patterns to support an optional hour component [HH:MM:SS.xx] and handle variable-length minute fields.
  • Modified parseLyrics to extract and include hours in the total millisecond calculation for both lines and individual words.
  • Updated syncedToLrcString to conditionally format timestamps using the [HH:MM:SS.xx] format when the duration exceeds one hour.
  • Added unit tests covering extended minute formats (e.g., [70:00.00]), explicit hour formats, and word-by-word synchronization for long tracks.

It now correctly recognises lyric time stamps for tracks over an hour. I have tested it with tracks over an hour and under an hour and they all show lyrics correctly. The tests all pass.

Before:
Screenshot_20260827-133757

After:
Screenshot_20260827-140636

Updated the lyrics utility to correctly parse and format LRC timestamps for tracks longer than 60 minutes.

- Updated `LRC_LINE_REGEX`, `LRC_WORD_REGEX`, and related patterns to support an optional hour component `[HH:MM:SS.xx]` and handle variable-length minute fields.
- Modified `parseLyrics` to extract and include hours in the total millisecond calculation for both lines and individual words.
- Updated `syncedToLrcString` to conditionally format timestamps using the `[HH:MM:SS.xx]` format when the duration exceeds one hour.
- Added unit tests covering extended minute formats (e.g., `[70:00.00]`), explicit hour formats, and word-by-word synchronization for long tracks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant