diff --git a/crates/arr-e2e/fixtures/podnapisi-farfetched.zip b/crates/arr-e2e/fixtures/podnapisi-farfetched.zip new file mode 100644 index 0000000..32c2a35 Binary files /dev/null and b/crates/arr-e2e/fixtures/podnapisi-farfetched.zip differ diff --git a/crates/arr-e2e/fixtures/podnapisi-plausible.zip b/crates/arr-e2e/fixtures/podnapisi-plausible.zip new file mode 100644 index 0000000..4f53394 Binary files /dev/null and b/crates/arr-e2e/fixtures/podnapisi-plausible.zip differ diff --git a/crates/arr-subs/src/sync.rs b/crates/arr-subs/src/sync.rs index e47b575..a1154d4 100644 --- a/crates/arr-subs/src/sync.rs +++ b/crates/arr-subs/src/sync.rs @@ -177,7 +177,9 @@ impl Syncer { async fn run(&self, video: &Path, subtitle: &Path, output: &Path) -> Result<()> { let mut command = Command::new(&self.binary); command - .args([subtitle, video]) + // `alass `: the + // video is the reference, never the other way round. + .args([video, subtitle]) .arg(output) .stdin(Stdio::null()) .stdout(Stdio::null()) @@ -327,7 +329,7 @@ mod tests { "1\n00:00:01,000 --> 00:00:02,500\nol\u{e1}\n\n2\n00:00:03,000 --> 00:00:04,000\ntwo lines\nof text\n"; /// Write an executable fake `alass`. Its body receives the three paths as - /// `$1` subtitle, `$2` video and `$3` output. + /// `$1` video, `$2` subtitle and `$3` output. async fn fake_binary(dir: &std::path::Path, body: &str) -> std::path::PathBuf { let path = dir.join("alass"); let mut file = tokio::fs::File::create(&path) @@ -372,7 +374,7 @@ mod tests { #[tokio::test] async fn an_unchanged_output_is_accepted_with_alass_text() { let dir = tempfile::tempdir().expect("test setup and fake binary succeed"); - let binary = fake_binary(dir.path(), "cp \"$1\" \"$3\"\n").await; + let binary = fake_binary(dir.path(), "cp \"$2\" \"$3\"\n").await; let subtitle = write_subtitle(dir.path(), "in.srt", PLAIN).await; let outcome = Syncer::new()