diff --git a/src/api/files.rs b/src/api/files.rs index b2f59491..b752a9e5 100644 --- a/src/api/files.rs +++ b/src/api/files.rs @@ -1185,9 +1185,10 @@ struct ReScanResponse { fn delete_output_files(uuid: &str) -> u64 { let mut deleted_count = 0u64; + // Check multiple output directories let output_dirs = [ config::OUTPUT_DIR.to_string(), - "/Users/accusys/momentry/output".to_string(), + // Legacy paths for backward compatibility during migration "/Users/accusys/momentry/output".to_string(), ]; diff --git a/src/core/processor/face.rs b/src/core/processor/face.rs index 512ae380..5a17e519 100644 --- a/src/core/processor/face.rs +++ b/src/core/processor/face.rs @@ -7,7 +7,7 @@ use super::FaceStatus; const FACE_TIMEOUT: Duration = Duration::from_secs(7200); -fn swift_processor_path(bin: &str) -> std::path::PathBuf { +pub fn swift_processor_path(bin: &str) -> std::path::PathBuf { use std::path::PathBuf; let rel = format!(".build/release/{}", bin); let rel = rel.as_str(); diff --git a/src/core/processor/ocr.rs b/src/core/processor/ocr.rs index d0e66db0..84bc8842 100644 --- a/src/core/processor/ocr.rs +++ b/src/core/processor/ocr.rs @@ -238,7 +238,8 @@ pub async fn process_ocr( ) -> Result { tracing::info!("[OCR] Starting text recognition: {}", video_path); - let swift_ocr_path = std::path::Path::new("/Users/accusys/momentry_core/scripts/swift_processors/.build/release/swift_ocr"); + // Resolve Swift OCR processor path + let swift_ocr_path = crate::core::processor::face::swift_processor_path("swift_ocr"); if swift_ocr_path.exists() { tracing::info!("[OCR] Using Swift processor: {:?}", swift_ocr_path); diff --git a/src/core/processor/tool_selector.rs b/src/core/processor/tool_selector.rs index db20f635..b92ff7c7 100644 --- a/src/core/processor/tool_selector.rs +++ b/src/core/processor/tool_selector.rs @@ -133,7 +133,9 @@ impl ToolSelector { if let Ok(output_dir) = std::env::var("MOMENTRY_OUTPUT_DIR") { vars.insert("output_dir".to_string(), output_dir); } else { - vars.insert("output_dir".to_string(), "/Users/accusys/momentry/output".to_string()); + // Resolve output_dir from environment or config + let output_dir = crate::core::config::OUTPUT_DIR.to_string(); + vars.insert("output_dir".to_string(), output_dir); } vars diff --git a/src/core/proxy.rs b/src/core/proxy.rs index 062ef432..5cc4a4f6 100644 --- a/src/core/proxy.rs +++ b/src/core/proxy.rs @@ -105,7 +105,8 @@ pub struct AudioTrackResult { /// Probe audio track and classify using VAD pub async fn probe_audio_track(file_path: &str) -> Result> { - let script = std::path::Path::new("/Users/accusys/momentry_core/scripts/audio_track_probe.py"); + let scripts_dir = crate::core::path_utils::scripts_dir(); + let script = scripts_dir.join("audio_track_probe.py"); if !script.exists() { tracing::warn!("[AUDIO_TRACK] Script not found: {}", script.display());