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 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.