diff --git a/src/worker/job_worker.rs b/src/worker/job_worker.rs index ddad33e3..c9cd88d8 100644 --- a/src/worker/job_worker.rs +++ b/src/worker/job_worker.rs @@ -2896,8 +2896,13 @@ async fn process_job(&self, job: crate::core::db::MonitorJob) -> Result<()> { } true } else { - let cluster_path = format!("{}/{}.face_cluster.json", output_dir, uuid); - let file_exists = std::path::Path::new(&cluster_path).exists(); + // Check BOTH per-library and global output dirs + // (rust_face_cluster writes to global OUTPUT_DIR via sync stub) + let cluster_path_lib = format!("{}/{}.face_cluster.json", output_dir, uuid); + let cluster_path_global = format!("{}/{}.face_cluster.json", + crate::core::config::OUTPUT_DIR.as_str().trim_end_matches('/'), uuid); + let file_exists = std::path::Path::new(&cluster_path_lib).exists() + || std::path::Path::new(&cluster_path_global).exists(); if file_exists { true } else { diff --git a/src/worker/processor.rs b/src/worker/processor.rs index 6b806ed8..b2c3f3fc 100644 --- a/src/worker/processor.rs +++ b/src/worker/processor.rs @@ -684,9 +684,9 @@ impl ProcessorPool { ) -> Result { let video_path = job.video_path.as_ref().context("No video path in job")?; - // Determine per-library output directory + // Determine per-library output directory (async, correct path resolution) let output_dir = PathBuf::from( - crate::core::config::get_output_dir_for_file_sync(&job.uuid, db.pool()) + crate::core::config::get_output_dir_for_file(&job.uuid, db.pool()).await ); let suffix = format!("{}.{}", job.uuid, processor_type.as_str()); let output_path = output_dir.join(format!("{}.json", suffix));