pub struct MatchEngine { /* private fields */ }Expand description
Engine for matching video and subtitle files using AI analysis.
Implementations§
Source§impl MatchEngine
impl MatchEngine
Sourcepub fn new(ai_client: Box<dyn AIProvider>, config: MatchConfig) -> Self
pub fn new(ai_client: Box<dyn AIProvider>, config: MatchConfig) -> Self
Creates a new MatchEngine with the given AI provider and configuration.
Sourcepub async fn match_file_list(
&self,
file_paths: &[PathBuf],
) -> Result<Vec<MatchOperation>>
pub async fn match_file_list( &self, file_paths: &[PathBuf], ) -> Result<Vec<MatchOperation>>
Matches video and subtitle files from a specified list of files.
This method processes a user-provided list of files, filtering them into video and subtitle files, then performing AI-powered matching analysis. This is useful when users specify exact files via -i parameters.
§Arguments
file_paths- A slice of file paths to process for matching
§Returns
A list of MatchOperation entries that meet the confidence threshold.
Sourcepub async fn match_file_list_with_audit(
&self,
file_paths: &[PathBuf],
) -> Result<MatchAudit>
pub async fn match_file_list_with_audit( &self, file_paths: &[PathBuf], ) -> Result<MatchAudit>
Auditable variant of MatchEngine::match_file_list that also returns
rejected candidates (sub-threshold or unresolvable AI suggestions).
When operations are served from cache, rejected is returned empty
because cache entries do not preserve rejection metadata.
Sourcepub async fn execute_operations(
&self,
operations: &[MatchOperation],
dry_run: bool,
) -> Result<()>
pub async fn execute_operations( &self, operations: &[MatchOperation], dry_run: bool, ) -> Result<()>
Execute match operations with dry-run mode support.
When dry_run is false, a transactional journal is written to
journal_path recording every successfully completed operation.
The journal is saved atomically after each operation so that a
crash mid-batch still leaves a consistent, resumable on-disk
record. No journal is written in dry-run mode or when the batch
performs zero operations.
Sourcepub async fn execute_operations_audit(
&self,
operations: &[MatchOperation],
dry_run: bool,
) -> Result<Vec<OperationOutcome>>
pub async fn execute_operations_audit( &self, operations: &[MatchOperation], dry_run: bool, ) -> Result<Vec<OperationOutcome>>
Auditable variant of MatchEngine::execute_operations that does NOT
abort on first failure. Each operation produces an OperationOutcome
describing whether it was applied or which error blocked it.
This is the engine entry point used by JSON output mode to surface per-item statuses in the success envelope.