feat(extract): auto-detect next disc, drop double confirmation#26
Merged
Conversation
Discs ≥ 2 are detected by polling drive_status. Press 'e' (single
keypress via cbreak stdin) to stop collecting and proceed to the
extraction phase. Disc 1 keeps the classic Enter prompt so the user
can read the header info before the run starts.
Drops the trailing `prompt_yn("Insert another disc?")` and the
`prompt_disc("Insert disc N")` confirmation for every N ≥ 2.
Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
drive_status(CDROM ioctl). No moreprompt_yn(\"Insert another disc?\")+prompt_disc(\"Insert disc N\")per transition.e(viatermioscbreak on stdin, no Enter needed) signals "done collecting, proceed to extract" — replaces the trailing Y/n confirmation.Press Enter when readyprompt so the user can read the header info before the run starts.Implementation
src/bd_archive/ui/keypress.py:cbreak_stdin()context manager (saves/restorestcgetattr, no-op on non-TTY) +read_keypress(timeout)(select-based, lowercased single char orNone)._wait_for_next_disc(dio, mount_dir, target)incommands/extract.py: polls drive + stdin every 300 ms, renders a Braille spinner on TTY stdout. Returns mount path on disc detect,Noneone.continuepath runs thefinally(umount + eject) and the next iteration re-enters the wait. No new validation logic._mount_with_promptstays untouched — still used for disc 1 and the par2-damage re-insert path (same-disc semantics, different concern).Test plan
bd-archive extract … | tee log.txt(non-TTY stdout) → no spinner spam, still works.bd-archive extract … < /dev/null(non-TTY stdin) → warns about 'e', polling still functions.🤖 Generated with Claude Code