One copy plan that both the CLI and the browser render #8
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
wokoman/ironpod#8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
One answer to "what will this copy do", produced by the copy module and rendered by whoever asked — the command line prints it, the browser puts it in a confirmation popup.
Both callers need the same four facts before a copy starts: which files were found, how many need converting, whether ffmpeg is available, and whether the copy should be refused outright. Neither asks for those facts; each assembles them by hand from three separate helpers. The predictable happened — the browser's version came out missing the refusal, which is #6.
Answering the question once, in the module that owns copying, means the two front ends differ only in how they present it. It also makes the pre-flight rules testable, which they currently are not in any form.
Something close to this already exists: the dry-run function answers a neighbouring question and reads every file's tags to do it. Whether the plan and the dry run become one thing or stay two is a design decision for whoever picks this up — worth settling first, because it decides how much of the existing function survives.
Acceptance criteria
cargo clippy --all-targetsclean; full suite passesBlocked by