Skip to content

add --cut, so a one-off cut needs no sidecar file - #20

Merged
noxend merged 3 commits into
mainfrom
cut-flag
Aug 30, 2026
Merged

add --cut, so a one-off cut needs no sidecar file#20
noxend merged 3 commits into
mainfrom
cut-flag

Conversation

@noxend

@noxend noxend commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Adds --cut, so cutting a stretch out of a recording no longer needs a .cuts file next to it:

shrinkit --cut 0:32-0:35 --cut 2:30-end recording.mov

The flag repeats, one range each, the same way the file takes one range per line, and it understands 0 and end for the clip edges exactly like the file does. When both are present the flag wins and the log says which sidecar it ignored. A range typed on the command line is an instruction for that one run, and quietly mixing it with the file's ranges would be the worse surprise of the two.

Most of the diff is a refactor that had to come first. The per-range validation lived inside the loop that reads the sidecar, with every rejection message hardcoded to name the file, so the flag had nothing it could reuse. That moved into one function that takes the range's origin as an argument, so both paths now share the same checks and the same wording, and the file path's log lines come out unchanged.

Testing it turned up two ways to lose work, both fixed here. --cut with the filename forgotten fell through to watch-folder mode, where it cut the same seconds out of every recording in the queue, overrode whatever sidecar each of them carried, and with keep_original = false deleted the sources and the sidecars it had just overridden.

An empty value did the same thing one level up. A wrapper expanding a variable it never set still counted as a cut being requested, so it suppressed the recording's real sidecar and then had no range to replace it with. Both now stop with a usage error before anything is encoded.

noxend added 3 commits August 28, 2026 10:21
repeatable, one range each, and it replaces the sidecar for that run the
same way every other flag beats the file it has an equivalent in
with no file named it fell through to the watch folder and cut the same
seconds out of every queued recording, overriding each one's own sidecar,
and with keep_original = false deleted the sources and sidecars it had
just overridden. an empty value counted as a cut request the same way,
suppressing a real sidecar while adding no range to replace it
@noxend
noxend merged commit 90b3626 into main Aug 30, 2026
2 checks passed
@noxend
noxend deleted the cut-flag branch August 30, 2026 08:21
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