Support numbered output filenames with %n counters - #225
Draft
ekisu wants to merge 4 commits into
Draft
Conversation
This was referenced Sep 11, 2026
ekisu
force-pushed
the
fix/issue-167
branch
from
September 12, 2026 00:53
bad8dd5 to
cab281f
Compare
ekisu
force-pushed
the
fix/issue-167
branch
from
September 12, 2026 00:56
cab281f to
ed4effc
Compare
ekisu
force-pushed
the
fix/issue-167
branch
from
September 12, 2026 01:16
ed4effc to
7ddbe30
Compare
ekisu
commented
Sep 12, 2026
Owner
Author
There was a problem hiding this comment.
Add other tests for the output template property
Owner
Author
There was a problem hiding this comment.
Addressed in d87262b. Added real-encode coverage for %f/%F/%T, fractional start/end timestamps with and without milliseconds, raw property expansion, missing-property fallback, positive/negative conditions (both inclusion and omission), literal percent/escaped counters, mixed escaped percent plus real counters, and repeated differently padded counters. Tests assert expected filenames, decodable output and preserved existing bytes. The 10 focused template tests pass; the full pinned-Nix suite passes 35 tests with 2 expected skips.
ekisu
force-pushed
the
fix/issue-167
branch
from
September 12, 2026 19:40
7ddbe30 to
d87262b
Compare
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
Support
%nand zero-padded counters such as%04ninoutput_template. Select the first unused filename in the resolved output directory, including the current directory, and document gap/reset semantics.Counters are captured before media-property expansion so counter-like text in a source filename stays literal. Conditional blocks that remove a counter do not trigger a filename search. Media substitutions use literal replacements for percent characters.
Fixes #167
Tracked in #217.
Verification
clip_%04n:clip_0001.mp4andclip_0002.mp4(65,384 bytes each); the first file's SHA-256 remained unchanged.Number selection occurs during formatting; concurrent independent encodes are not atomically reserved. No persistent counter is stored.
Current harness-based verification (supersedes historical test notes)
Rebased onto master
72d9d11, which includes #226 and #227. Tests load the normal built script and drive real mpv.Three real-encode regressions cover padded sequential names, preserving existing files and filling gaps, and literal counter-looking source filenames. All three fail on the unfixed script. Pinned Nix: 17 tests, 16 passed, 1 existing audio skip.
Latest rebase verification
Rebased onto master
72d9d11after #227 merged. Normal build and the complete pinned-Nix suite pass, with two expected skips (audio fixture and unavailable optional libaom-av1 encoder).Review feedback addressed — 2026-09-12
Expanded output-template coverage to 10 focused real-mpv tests, including media placeholders, fractional timestamps, raw properties/fallback/conditions, escaped percent/counters and repeated padded counters. Full pinned-Nix suite: 37 tests, 35 passed and 2 expected skips. GitHub build/test checks pass.
Rebased onto master after #220, #221, #223 and #224 merged.