Compare commits

...

2 commits

Author SHA1 Message Date
963c3fb7c1 test(clips): cover the raised target_clips ceiling
All checks were successful
CI / unit (pull_request) Successful in 53s
CI / backend-e2e (pull_request) Successful in 1m25s
CI / dashboard-e2e (pull_request) Successful in 2m38s
Update the out-of-range assertion to the new band and add a positive
case proving 31 queues the CLIP_TARGET_MIN/MAX override while 32 is
still rejected.
2026-10-11 21:10:05 +01:00
87ccc3fa59 feat(clips): raise "clips to aim for" ceiling from 15 to 31
The advanced-options control was capped at 15 in both the dashboard
input and the /api/process validator. Lift both to 31 so callers can
aim for longer clip batches; the value is still an honest target, not a
guarantee.
2026-10-11 21:10:05 +01:00
3 changed files with 25 additions and 3 deletions

View file

@ -2467,7 +2467,7 @@ async def process_endpoint(
detail=f"{name} must be between {lo:g} and {hi:g}") detail=f"{name} must be between {lo:g} and {hi:g}")
return int(val) if integer else val return int(val) if integer else val
n_clips = _gen_control(target_clips, "target_clips", 1, 15, integer=True) n_clips = _gen_control(target_clips, "target_clips", 1, 31, integer=True)
min_secs = _gen_control(clip_min_seconds, "clip_min_seconds", 5, 175) min_secs = _gen_control(clip_min_seconds, "clip_min_seconds", 5, 175)
max_secs = _gen_control(clip_max_seconds, "clip_max_seconds", 10, 180) max_secs = _gen_control(clip_max_seconds, "clip_max_seconds", 10, 180)
if min_secs is not None and max_secs is not None and max_secs < min_secs + 5: if min_secs is not None and max_secs is not None and max_secs < min_secs + 5:

View file

@ -413,7 +413,7 @@ export default function MediaInput({ onProcess, isProcessing }) {
<div> <div>
<p className="eyebrow mb-1.5">clips to aim for</p> <p className="eyebrow mb-1.5">clips to aim for</p>
<input <input
type="number" min="1" max="15" step="1" type="number" min="1" max="31" step="1"
value={targetClips} value={targetClips}
onChange={(e) => setTargetClips(e.target.value)} onChange={(e) => setTargetClips(e.target.value)}
placeholder="auto" placeholder="auto"

View file

@ -261,7 +261,29 @@ async def test_target_clips_validation(client, media_factory):
{"file": ("clip.mp4", media_factory.six.read_bytes(), "video/mp4")}, {"file": ("clip.mp4", media_factory.six.read_bytes(), "video/mp4")},
) )
assert out_of_range.status_code == 400 assert out_of_range.status_code == 400
assert "target_clips must be between 1 and 15" in out_of_range.json()["detail"] assert "target_clips must be between 1 and 31" in out_of_range.json()["detail"]
async def test_target_clips_accepts_raised_ceiling(
client, app_state, media_factory):
# The ceiling was raised from 15 to 31; the top of the new band must queue
# with the override the selector reads, and 32 must still be rejected.
resp = await _submit_file(
client,
{"acknowledged": "true", "target_clips": "31"},
{"file": ("clip.mp4", media_factory.six.read_bytes(), "video/mp4")},
)
job_id = _job(client, resp)
env = app_state.app.jobs[job_id]["env"]
assert env["CLIP_TARGET_MIN"] == "31" and env["CLIP_TARGET_MAX"] == "31"
too_many = await _submit_file(
client,
{"acknowledged": "true", "target_clips": "32"},
{"file": ("clip.mp4", media_factory.six.read_bytes(), "video/mp4")},
)
assert too_many.status_code == 400
assert "target_clips must be between 1 and 31" in too_many.json()["detail"]
async def test_clip_range_validation(client, media_factory): async def test_clip_range_validation(client, media_factory):