Conversation
The current Web MiniDisc Pro client uses netmd-js 4.x, which this server had not been updated for. Against a 4.x netmd-js the old code fails: EKBOpenSource is no longer exported and MDSession resolves the EKB internally. - MDSession: drop the EKBOpenSource argument; init() derives the EKB from the device's vendor/product IDs. new MDSession(device). - Track converters: report SP as SPS (stereo) / SPM (mono) and MDLP as AT3 with a bitrate, matching what the current client sends and displays. - /upload: accept the SPS/SPM codec names the current client sends (both map to the PCM wireformat) and record SPM with the mono disc format. - normalizeGroups: a blank disc returns an empty groups array from netmd-js; synthesize the ungrouped bucket the client expects, and make the group/track converters null-safe. - package.json: depend on the published netmd-js ^4.4.1. Tested live against a Sony MZ-N505 (SP and LP2 uploads, disc listing, group rewrite). Happy to keep the file:../netmd-js dependency style if preferred.
Author
|
Verification note — ran this branch's exact code against real hardware before opening:
Note: kept separate from the version-independent |
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.
Why
Web MiniDisc Pro (the client at web.minidisc.wiki, and as far as I know the only client) now uses netmd-js 4.x and a codec-based format model. This server targets the older 3.x API, so against a current netmd-js it breaks —
EKBOpenSourceis no longer exported,MDSessionresolves the EKB internally, and the track/format names changed. The net effect is that a fresh setup can't record with the current client.This brings the server up to date. (Complements the client-side fix in asivery/webminidisc#99.)
Changes
EKBOpenSourceargument. In 4.xinit()derives the EKB from the device's vendor/product IDs, so it's justnew MDSession(device).SPS(stereo) /SPM(mono) and MDLP asAT3+ bitrate, matching what the current client sends and renders.SPS/SPMcodec names the current client sends (both → PCM wireformat), and recordSPMwithDiscFormat.spMono.groupsarray; synthesize the "ungrouped" bucket the client expects, and make the group/track converters null-safe.netmd-js@^4.4.1instead of a local working tree. (Easy to revert tofile:if you'd rather keep the working-tree workflow.)Testing
Ran live against a Sony MZ-N505:
/prepareUploadcompletes the EKB session handshake, disc listing / group rewrite work, and SP + LP2 uploads complete.Notes
/rewriteGroups+ upload-lock bug fixes (Fix /rewriteGroups guard+await and release device lock on aborted upload #5), which are version-independent. There may be a trivial rebase where the two touch the/uploadhandler.