Skip to content

Conversation

@Maxr1998
Copy link
Contributor

Word time tags are absolute timestamps in the lyrics, so having multiple line times would generally conflict with them. Thus, they should be just ignored instead, since the format is wrong.
The same applies if there is no line time tag, in that case, it wouldn't be known when the first word starts.
Both are inconsidered incorrect LRC and thus only parsed on a best-effort basis.

@andy840119
Copy link
Member

I know lrc support multiple line times with one lyric line, but i did not remember the time tag will be dropped.
Is that a lrc spec?
Or this change is made because you feels reasonable?

@Maxr1998
Copy link
Contributor Author

Maxr1998 commented Jun 22, 2025

Since there's no official spec, it's hard to quote one, but this new behavior is reasonable because of the mentioned conflict between line time and absolute word times. I've alwo never seen a mix of multiple line times and word times being used in the wild.

It's also a requirement for #85, which uses the line time for the initial word.

@andy840119
Copy link
Member

I've alwo never seen a mix of multiple line times and word times being used in the wild.

I know it's hard to have those case, but if it's still reasonable to keep both multiple line times and word times?

@Maxr1998
Copy link
Contributor Author

Maxr1998 commented Jun 22, 2025

I know it's hard to have those case, but if it's still reasonable to keep both multiple line times and word times?

I don't think it is, since I'd prefer to not parse them at all than to return wrong results. If the line isn't parsed, the user will notice their mistake and fix the LRC file.

@andy840119
Copy link
Member

andy840119 commented Jun 22, 2025

If that so, maybe tell the reason before if (startTimes.Length is 0 or > 1) why need to handle this condition.

e.g.

It's not possible to have multiple line times and word times.
If both case happened, for xxx reason, will drop the time-tag info.

@Maxr1998
Copy link
Contributor Author

Tweaked the comment 👍

Copy link
Member

@andy840119 andy840119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can give it a pass that drop the time-tag if has multiple time-tags.
But I'm not fully convinced, which future developers might have same issue.

Give adjust the comment a try ✊🏼

Word time tags are absolute timestamps in the lyrics, so having multiple line times would generally conflict with them. Thus, they should be just ignored instead, since the format is wrong.
The same applies if there is no line time tag, in that case, it wouldn't be known when the first word starts.
Both are inconsidered incorrect LRC and thus only parsed on a best-effort basis.
Copy link
Member

@andy840119 andy840119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider those edge not happened frequently, it's ok for me to handle with this way.

@andy840119 andy840119 merged commit 167a45e into karaoke-dev:main Jun 22, 2025
3 checks passed
@Maxr1998 Maxr1998 deleted the limit-line-time branch June 22, 2025 14:39
@andy840119 andy840119 added the Breaking change This change might let parsing result not same as before. label Jun 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking change This change might let parsing result not same as before. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants