Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rounding Bugs with the Milliseconds Part in the Timestamp #109

Closed
daoxi opened this issue Jul 11, 2022 · 1 comment
Closed

Rounding Bugs with the Milliseconds Part in the Timestamp #109

daoxi opened this issue Jul 11, 2022 · 1 comment
Assignees
Labels

Comments

@daoxi
Copy link
Contributor

daoxi commented Jul 11, 2022

When using the 2-millisecond-digits LRC format [mm:ss.SS] (which is the standard format for LRC) and choosing to round the milliseconds number, it doesn't work as intended in certain scenarios:

For example, for this song:
The original timestamp

[04:17.995]Everybody Get Low

will be rounded to

[04:17.10]Everybody Get Low

instead of the correct result

[04:18.00]Everybody Get Low

Another example in the same song:
The original timestamp

[04:19.093]It's A Stickup Everybody Get Low

will be rounded to

[04:19.93]It's A Stickup Everybody Get Low

instead of the correct result

[04:19.09]It's A Stickup Everybody Get Low

To summarize, there are two issues with rounding in the timestamp:

  1. (as demonstrated in the 1st example) it can't round up the "ss" part when the "SS" part exceeds 99 (and it probably also can't round up the "mm" part when the "ss" part exceeds 59, for example, rounding a timestamp like [01:59.999] should result [02:00.00] rather than [01:60.00])
  2. (as demonstrated in the 2nd example) it omits/removes the zero(s) in miliseconds part from the original timestamp when it shouldn't. Please note that this issue happens no matter which option (either rounding or cropping the millisecond number) is selected.

Version tested: v4.6

--------------------------------Edit/Update--------------------------------

I just realized these two issues mentioned above only happens when you use NetEase Cloud Music as the lyrics source, I'm guessing it's because QQ Music already uses the standard format [mm:ss.SS], therefore the format conversion (including either rounding or cropping the numbers) is NOT performed when you choose [mm:ss.SS]?
Note that a bug exists with lyrics from QQ Music too, see the post below for more detail.

@daoxi daoxi added the bug label Jul 11, 2022
@daoxi
Copy link
Contributor Author

daoxi commented Jul 13, 2022

Found another bug which might also be related to how you dealt with the millisecond digits (i.e. it's probably related to the 2nd issue mentioned above):

The program seems to be adding extra zeros in the wrong place when choosing to use the [mm:ss.SSS] format.

Take this song as an example, when choosing to use the [mm:ss.SSS] format, the first few timestamps are:

[00:10.098]
[00:12.066]
[00:17.053]
[00:21.042]
[00:26.058]

(notice how the first digit in the SSS part is always 0 (this actually happens for the entire song too), so I'm assuming the original lyrics use the format [mm:ss.SS] rather than [mm:ss.SSS]), and when the program is trying to convert the format, it added zeros in the wrong place.

I suppose the correctly converted timestamps should be:

[00:10.980]
[00:12.660]
[00:17.530]
[00:21.420]
[00:26.580]

(notice how the zeros should be added in the end, not the beginning.)

*This bug seems to happen only when QQ Music is used as the source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants