Sync subtitles with alass #194
Notifications
Due Date
No due date set.
Blocks
Depends on
Reference: yolo/arr#194
Reference in New Issue
Block a user
Wrap
alassinarr-subsand run it over every subtitle arr obtains, fetchedor translated (DESIGN.md §15, added by #183). It is a single small binary
invoked and discarded like
ffprobe, so it adds nothing at rest.alassreports no confidence value, so trust is bounded structurally ratherthan by a score:
60 seconds from where it started, or cues lost between input and output.
the subtitle row (#186), so the missing-subtitles queue can surface it and the
operator can re-run it by hand.
both on disk when this runs.
The binary path is configurable like
ffprobe's, and its absence is a healthcondition (#200), not a panic.
Depends on: #184, #212
Implemented the
alasswrapper asarr_subs::sync(crates/arr-subs/src/sync.rs), in the same shape asarr-probe's ffprobe wrapper: aSyncerwith a configurable binary path (with_binary, defaultalass, already wired toalass_pathin the daemon config) and a timeout. It runsalass <sub> <video> <output>against a temp output file, parses both input and output back throughsrt::parse, and judges plausibility structurally per DESIGN.md §15: any cue moved more than 60 seconds from its start, or cues lost between input and output, yieldsOutcome::Rejected(Rejection)so the caller keeps the unsynced original and recordsSubtitleSync::Rejectedon the row (#186's columns andmark_syncedalready exist). A plausible result returnsOutcome::Accepted { content }with the synced SRT. New error variants:Spawn(missing binary — a #200 health condition, non-transient),Timeout(transient),SyncFailed(non-zero exit, carries status + trimmed stderr) andNotSrt. The daemon-side invocation lands with #195/#196, which own writing sidecars to disk; nothing calls the syncer yet.Branch:
subtitles/194-alass-syncjust ci: passed via the gate (569 tests, lint, fmt, web-check all green).No fixtures involved; all sync tests generate fake
alassshell scripts at runtime.Findings
sync()only after #213 converts them; until then the wrapper fails them withError::NotSrt. That is the correct failure mode but means ASS fetches will be recorded as failed attempts if wired before #213 merges.