Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(lyrics): keep interleaved romaji out of the lyric list (#232) (#246)

2 months ago

8bdb68b
Authored
Davy7/26/2026, 2:54:41 AM
Bilingual lyric sources — the norm for Japanese songs on LrcLib and in embedded
tags — ship the romaji transcription as its own timestamped line:

    [00:00.85]どうでもいいような 夜だけど
    [00:00.85]doudemoiiyouna yorudakedo

The parser has no notion of a companion line, so both became full-size peer
lyrics: romaji showed at primary size, interleaved, and — since it is lyric data
rather than the app's own overlay — regardless of the Romanized-lyrics toggle.
Confirmed by reading the affected song's cached LRC; the romanizer itself was
behaving correctly all along.

Lift those transcriptions out of the lyric list where lines enter the store and
return them as the parallel romanization array, so a romaji line can only ever
appear as the attached sub-line under its primary line, and only while
romanization is enabled. A source set that covers every line seeds the
romanization cache, so enabling the toggle shows the source transcription
without running the romanizer; a partial set leaves the cache identity null so
the romanizer recomputes a full set.

Extraction is deliberately conservative, because Japanese lyrics routinely
contain genuine English lines that must never be deleted as somebody else's
pronunciation guide: the file must look overwhelmingly interleaved before any
line is reclassified, and a candidate must share its primary's timestamp. A
transcription mis-stamped with a different beat is indistinguishable — by
timestamp, count, or alternation — from a real Latin-script lyric at that beat,
so it stays a lyric line: a visible duplicate in a sloppy source beats dropping
someone's chorus.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Parent8ec7cd5

4 files changed
  • src/lib/lyrics-companion-romanization.test.ts+223−0
  • src/lib/lyrics-companion-romanization.ts+146−0
  • src/stores/lyrics-store.test.ts+85−0
  • src/stores/lyrics-store.ts+44−5