diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-02-23 16:02:52 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-02-23 16:02:52 +0100 |
| commit | 807cde3a096a6e87d13a98d2ee78578732b1fb45 (patch) | |
| tree | dce8fb97978f6a0696517133ff9600f983ce5496 | |
| parent | be7d35ccbb3449332700a0d9ccb1b055e041e401 (diff) | |
| download | jellything-807cde3a096a6e87d13a98d2ee78578732b1fb45.tar jellything-807cde3a096a6e87d13a98d2ee78578732b1fb45.tar.bz2 jellything-807cde3a096a6e87d13a98d2ee78578732b1fb45.tar.zst | |
fix incorrectly spawning fpcalc processes
| -rw-r--r-- | import/src/lib.rs | 2 | ||||
| -rw-r--r-- | import/src/plugins/acoustid.rs | 10 |
2 files changed, 3 insertions, 9 deletions
diff --git a/import/src/lib.rs b/import/src/lib.rs index ecb39db..232d9e0 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -3,7 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2026 metamuffin <metamuffin.org> */ -#![feature(duration_constants)] +#![feature(duration_constants, exit_status_error)] pub mod helpers; pub mod plugins; diff --git a/import/src/plugins/acoustid.rs b/import/src/plugins/acoustid.rs index 411f9d1..e0d1a96 100644 --- a/import/src/plugins/acoustid.rs +++ b/import/src/plugins/acoustid.rs @@ -20,7 +20,6 @@ use reqwest::{ }; use serde::{Deserialize, Serialize}; use std::{ - io::Read, path::Path, process::{Command, Stdio}, sync::Arc, @@ -153,15 +152,10 @@ pub(crate) fn acoustid_fingerprint(cache: &Cache, path: &Path) -> Result<Arc<Fin .spawn() .context("fpcalc")?; - let mut buf = Vec::new(); - child - .stdout - .unwrap() - .read_to_end(&mut buf) - .context("read fpcalc output")?; + let output = child.wait_with_output()?.exit_ok()?; let out: FpCalcOutput = - serde_json::from_slice(&buf).context("parsing fpcalc output")?; + serde_json::from_slice(&output.stdout).context("parsing fpcalc output")?; let out = Fingerprint { duration: out.duration as u32, fingerprint: out.fingerprint, |