pub fn resolve_sync_pairing(
request: &SyncPairingRequest,
) -> Result<SyncMode, SubXError>Expand description
Decide whether a sync invocation is a single pair or a batch, auto-pairing a lone video or subtitle with its sibling on disk.
Algorithm (locked by the timeline-sync capability spec):
- Any batch trigger (
batch != Off, non-emptyinput_paths, or an extension-less positional path) selectsSyncMode::Batch, with the handler’s paths ordered batch directory →-ipaths → positionals and defaulting to["."]when empty. - A lone positional path is classified by its lower-cased extension and
probed for a
<stem>.<ext>sibling over the declared extension lists. - Two positional paths are classified by extension without probing.
- Otherwise the explicit
video/subtitlefields are used. - In manual mode a resolved subtitle with no video yields
SyncMode::Singlewith an emptyPathBufvideo (“no video required” sentinel). - Anything else returns
SubXError::InvalidSyncConfiguration.