Gramophone icon indicating copy to clipboard operation
Gramophone copied to clipboard

Fix lyrics parsing actual lyrics lines as translations for a blank lyric line

Open mikooomich opened this issue 4 months ago • 5 comments

Some lyrics providers have lyrics that use duplicated timestamps for formatting reasons, causing the blank line to be parsed as the main lyric, and the second (actual line) to be parsed as a translation. After this change, blank lines will not be eligible for translation.

See the following for an example without translations:

[00:23.73]I see the world through eyes covered in ink and bleach [00:29.70]Cross out the ones who heard my cries and watched me weep [00:35.64]
[00:35.64]I love everything
[00:38.51]Fire's spreading all around my room
[00:43.13]My world's so bright
[00:44.42]It's hard to breathe but that's alright
[00:47.32]Hush
[00:59.22]
[00:59.22]Shh
[01:11.46]
[01:11.46]Tape my eyes open to force reality (oh no, no) [01:17.99]Why can't you just let me eat my weight in glee?
Before After
Screenshot_20250816_143258 Screenshot_20250816_143348

Lmk if you want me to write tests for this

mikooomich avatar Aug 16 '25 18:08 mikooomich

just fyi "The code in new lyric view to determine current y offset of active lyric line" is still pending

nift4 avatar Aug 26 '25 11:08 nift4

@copilot review this pr

nift4 avatar Aug 31 '25 20:08 nift4

  1. why are you removing blank translations generally? also testTemplateLrcTranslationType1 fails
  2. meizu status bar lyric can only display one lyric line at a time and right now it will make it display blank one while lyric with actual content is hidden because it takes first lyric at timestamp, maybe filter blank lines out in that method? https://github.com/FoedusProgramme/Gramophone/blob/d778b0c94bfc9494a87f4ca28a23fa501c84d5f1/app/src/main/java/org/akanework/gramophone/logic/GramophonePlaybackService.kt#L982-L986

nift4 avatar Oct 05 '25 06:10 nift4

  1. I removed it because extra spacing looks a bit odd. I can revert it nonetheless
  2. I'll look into it

mikooomich avatar Oct 05 '25 19:10 mikooomich

I can't verify Meizu status bar lyrics, but did verify the indexes that were sent to the widget. They seemed to match up with what should be displayed.

mikooomich avatar Nov 06 '25 01:11 mikooomich