Browser refuses a copy that needs ffmpeg when ffmpeg is missing #18

Merged
wokoman merged 1 commit from fix/tui-refuse-copy-without-ffmpeg into main 2026-08-28 20:12:40 +02:00
Owner

The browser refuses a copy that cannot possibly succeed, instead of starting it and failing file by file.

Mark a folder of FLACs on a machine without ffmpeg and press c, and the copy began, converted nothing, and reported every file as failed. The command line never behaved that way — it checked up front and refused before opening the device. The rule and its message now live in the copy module, so the check exists once and neither front end can forget it or word it differently.

The command line keeps its short-circuiting any, and the browser passes the count it already computes while drawing the confirmation, so nothing reads tags twice.

Verified against the real device with ffmpeg removed from PATH:

  • Command line: refuses with the unchanged message, and refuses before opening the device — during one run the iPod had silently unmounted and the output was still the ffmpeg refusal rather than a mount error.
  • Browser: driven through expect at a real terminal size, marking the FLAC and pressing c puts the refusal in the status line and no confirmation popup appears at all, so the copy never starts. Nothing was written to the device.

The unit test can only assert the half that does not depend on the machine — that nothing needing conversion is never refused, and that the other arm agrees with whether ffmpeg is actually present. Forcing the absent-ffmpeg branch in-process is not possible: the probe is cached in a OnceLock for the life of the process. That is what the PATH-stripped runs above are for.

66 unit tests pass, cargo clippy --all-targets clean.

Closes #6.

The browser refuses a copy that cannot possibly succeed, instead of starting it and failing file by file. Mark a folder of FLACs on a machine without ffmpeg and press `c`, and the copy began, converted nothing, and reported every file as failed. The command line never behaved that way — it checked up front and refused before opening the device. The rule and its message now live in the copy module, so the check exists once and neither front end can forget it or word it differently. The command line keeps its short-circuiting `any`, and the browser passes the count it already computes while drawing the confirmation, so nothing reads tags twice. Verified against the real device with ffmpeg removed from `PATH`: - Command line: refuses with the unchanged message, and refuses *before* opening the device — during one run the iPod had silently unmounted and the output was still the ffmpeg refusal rather than a mount error. - Browser: driven through `expect` at a real terminal size, marking the FLAC and pressing `c` puts the refusal in the status line and **no confirmation popup appears at all**, so the copy never starts. Nothing was written to the device. The unit test can only assert the half that does not depend on the machine — that nothing needing conversion is never refused, and that the other arm agrees with whether ffmpeg is actually present. Forcing the absent-ffmpeg branch in-process is not possible: the probe is cached in a `OnceLock` for the life of the process. That is what the `PATH`-stripped runs above are for. 66 unit tests pass, `cargo clippy --all-targets` clean. Closes #6.
Marking a folder of FLACs without ffmpeg installed started the copy and
failed every file. The command line already refused up front; the rule
now lives behind the copy module so neither front end can forget it.

Closes #6.
wokoman deleted branch fix/tui-refuse-copy-without-ffmpeg 2026-08-28 20:12:40 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
wokoman/ironpod!18
No description provided.