From da1a932459b55b8642f3c77c84f07da09dc432b5 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Tue, 25 Aug 2026 05:25:19 +0100 Subject: [PATCH] fix(arr): correct alass reference/subtitle argument order Syncer::run passed [subtitle, video] where alass expects ; every real invocation failed before comparing timings, silently degrading to SyncState::NotRun. --- crates/arr-e2e/fixtures/podnapisi-farfetched.zip | Bin 0 -> 296 bytes crates/arr-e2e/fixtures/podnapisi-plausible.zip | Bin 0 -> 220 bytes crates/arr-subs/src/sync.rs | 8 +++++--- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 crates/arr-e2e/fixtures/podnapisi-farfetched.zip create mode 100644 crates/arr-e2e/fixtures/podnapisi-plausible.zip diff --git a/crates/arr-e2e/fixtures/podnapisi-farfetched.zip b/crates/arr-e2e/fixtures/podnapisi-farfetched.zip new file mode 100644 index 0000000000000000000000000000000000000000..32c2a35d0dfd3abc503182483148452cb7c76994 GIT binary patch literal 296 zcmWIWW@Zs#0D&Y;$=Fzt6-#q~Y!KE3V&D9-%v8OQjH1+3JtG4n6Fox%3xfi^a91Z? z7av{sApg(+y@C?mfDpanq7p+c0|P4qQ!4`l9RmXc1zlY`1*m|bj;VnGS8{%CK~8E( zYEGp>X hGj4|i-3|r~j3A06Zv=R=vVk-)0%0_e-VWk0001k1LL>kH literal 0 HcmV?d00001 diff --git a/crates/arr-e2e/fixtures/podnapisi-plausible.zip b/crates/arr-e2e/fixtures/podnapisi-plausible.zip new file mode 100644 index 0000000000000000000000000000000000000000..4f533942dd7b710ef574c80c755d3ce24be2c5e5 GIT binary patch literal 220 zcmWIWW@Zs#0D&Y;$=LSAX;CUbHVA72v2T7^W~!clUaFpvfsu)xp@D@#fnK<)ldg-8 zu6vMwXn 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()