ass_set_durations
Set selected subtitle line durations to a specific minimum and maximum range by moving the start or end edge, with dry-run and overlap options.
Instructions
Pull every selected line into the [min_ms, max_ms] duration window.
Only the edge named by mode moves — "stretch" (default) keeps the
start and moves the end, "start" keeps the end and moves the start. A
line is never moved past the neighbouring line on the same layer unless
allow_overlap is True, and never past keep gaps (there are none by
default, so the limit is the neighbour's exact start).
Args:
selection: lines to adjust.
min_ms: minimum duration; shorter lines are lengthened.
max_ms: maximum duration; longer lines are shortened.
mode: "stretch"/"end" (move the end) or "start" (move the
start).
doc_id: document id.
dry_run: when True (the default) nothing is written — the response shows
exactly what would happen.
allow_overlap: allow the new edge to cross the neighbouring line.
Returns:
{"doc_id", "dry_run", "applied", "mode", "window": {"min_ms", "max_ms"}, "allow_overlap", "count", "changes": [{"index", "field", "old_ms", "new_ms", "old", "new", "reason"}], "blocked": [{"index", "reason", "wanted_ms", "limit_ms"}]}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | stretch | |
| doc_id | No | ||
| max_ms | No | ||
| min_ms | No | ||
| dry_run | No | ||
| selection | No | ||
| allow_overlap | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||