Repository navigation
Convert the disc's used time from frames to seconds like left and total - #115
Open
iconscious wants to merge 1 commit into
Open
iconscious wants to merge 1 commit into
iconscious wants to merge 1 commit into
Conversation
convertDiscToWMD divided `left` and `total` by 512 to turn netmd-js's frame counts into seconds but left `used` in frames, and convertDiscToNJS did the reverse. Everything that reads `disc.used` therefore saw a frame count: the main screen's "used of total" toggle, and the CSV export. The two-digit minute padding in formatTimeFromSeconds hid it by keeping only the last two digits, so a disc with 18:17 recorded displayed as 61:50 instead of an obviously wrong number. Seen on a Sony MZ-N1 (getDiscCapacity returned 0:18:17:46 recorded, 1:14:59:40 total, 0:55:53:13 available; the UI showed 61:50 used). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
convertDiscToWMDdividesleftandtotalby 512 to turn netmd-js's frame counts into seconds, but leavesusedin frames;convertDiscToNJShas the mirror-image gap. This adds the missing line to each.Symptom
Everything that reads
disc.usedsees a frame count: the main screen's "used of total" toggle (click the time line under the device name) and the CSV export.formatTimeFromSecondspads minutes with('00' + m).slice(-2), which keeps only the last two digits, so the number looks plausible instead of obviously wrong.On a Sony MZ-N1 with
getDiscCapacity()returningthe UI showed 61:50 used (9361:50 truncated to two digits) next to 55:53 free on a 74:59 disc. After the change it shows 18:18.
Testing
Checked on the MZ-N1 over WebUSB: the used figure now reads 18:18 against 55:53 free on a 74:59 disc. The "used of total" toggle and the CSV export read the same field. The MockMD service is unaffected (its disc already carries seconds).
🤖 Generated with Claude Code