Skip to content

Convert the disc's used time from frames to seconds like left and total - #115

Open
iconscious wants to merge 1 commit into
asivery:masterfrom
iconscious:fix-disc-used-frames
Open

iconscious wants to merge 1 commit into
asivery:masterfrom
iconscious:fix-disc-used-frames

Conversation

@iconscious

Copy link
Copy Markdown

What

convertDiscToWMD divides left and total by 512 to turn netmd-js's frame counts into seconds, but leaves used in frames; convertDiscToNJS has the mirror-image gap. This adds the missing line to each.

Symptom

Everything that reads disc.used sees a frame count: the main screen's "used of total" toggle (click the time line under the device name) and the CSV export. formatTimeFromSeconds pads 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() returning

recorded 0:18:17:46 | total 1:14:59:40 | available 0:55:53:13

the 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

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>
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.

1 participant