Skip to content

fix: remove (imprecise) seconds->milliseconds conversion#271

Merged
kaneryu merged 3 commits intoqwertyquerty:masterfrom
f0e:fix/seconds-to-ms
Nov 2, 2025
Merged

fix: remove (imprecise) seconds->milliseconds conversion#271
kaneryu merged 3 commits intoqwertyquerty:masterfrom
f0e:fix/seconds-to-ms

Conversation

@f0e
Copy link
Contributor

@f0e f0e commented Oct 30, 2025

The new millisecond to second conversion code has an issue, the cast to int removes float precision. For example if you pass 1.5 seconds in it'll be turned into 1 second, then 1000 milliseconds. This caused my music progress duration to go up and down a second every time I updated it.

Rather than fix this, I think it'd be better to revert the start and end arguments to be milliseconds again as changing them to seconds is a breaking change that I don't personally see being a benefit.

This PR:

  • Makes start and end arguments (integer) milliseconds again
  • Updates the docs to explicitly state that these arguments are milliseconds
  • Removes the test case for millisecond to second conversion

@f0e f0e force-pushed the fix/seconds-to-ms branch from 81e6e62 to 872ccba Compare November 1, 2025 07:04
@kaneryu
Copy link
Collaborator

kaneryu commented Nov 2, 2025

Thanks for the work!

@kaneryu kaneryu merged commit 168c0fc into qwertyquerty:master Nov 2, 2025
16 checks passed
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.

2 participants

Comments