diff --git a/src/api/files.rs b/src/api/files.rs index b752a9e5..c5feace1 100644 --- a/src/api/files.rs +++ b/src/api/files.rs @@ -249,8 +249,7 @@ pub(crate) async fn register_single_file( .map(|n| n.to_string_lossy().to_string()) .unwrap_or_default(); - let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR") - .unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string()); + let output_dir = crate::core::config::OUTPUT_DIR.to_string(); let birthday = std::fs::metadata(&path) .ok() @@ -411,8 +410,7 @@ pub(crate) async fn register_single_file( let temp_probe_json: serde_json::Value = if let Some(ref pre) = pre_data { pre.get("probe_json").cloned().unwrap_or_default() } else { - let scripts_dir = std::env::var("MOMENTRY_SCRIPTS_DIR") - .unwrap_or_else(|_| "/Users/accusys/momentry_core_0.1/scripts".to_string()); + let scripts_dir = crate::core::path_utils::scripts_dir().to_string_lossy().to_string(); let python_path = std::env::var("MOMENTRY_PYTHON_PATH") .unwrap_or_else(|_| "/opt/homebrew/bin/python3.11".to_string()); crate::core::probe::unified::unified_probe(&path, &scripts_dir, &python_path).await @@ -507,10 +505,8 @@ pub(crate) async fn register_single_file( let mut cut_done = false; if has_video && total_frames > 0 && fps > 0.0 { - let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR") - .unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string()); - let scripts_dir = std::env::var("MOMENTRY_SCRIPTS_DIR") - .unwrap_or_else(|_| "/Users/accusys/momentry_core_0.1/scripts".to_string()); +let output_dir = crate::core::config::OUTPUT_DIR.to_string(); + let scripts_dir = crate::core::path_utils::scripts_dir().to_string_lossy().to_string(); let python_path = std::env::var("MOMENTRY_PYTHON_PATH") .unwrap_or_else(|_| "/opt/homebrew/bin/python3.11".to_string()); @@ -574,8 +570,7 @@ pub(crate) async fn register_single_file( }); let audio_tracks_json = serde_json::to_value(&audio_tracks).ok(); let cut_path = std::path::Path::new( - &std::env::var("MOMENTRY_OUTPUT_DIR") - .unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string()), + &crate::core::config::OUTPUT_DIR.to_string(), ) .join(format!("{}.cut.json", file_uuid)); let mut cut_count = 0i32; @@ -607,8 +602,7 @@ pub(crate) async fn register_single_file( if let Some(json_val) = probe_json { let probe_path = std::path::Path::new( - &std::env::var("MOMENTRY_OUTPUT_DIR") - .unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string()), + &crate::core::config::OUTPUT_DIR.to_string(), ) .join(format!("{}.probe.json", file_uuid)); let json_str = serde_json::to_string_pretty(&json_val).unwrap_or_default(); @@ -1188,8 +1182,6 @@ fn delete_output_files(uuid: &str) -> u64 { // Check multiple output directories let output_dirs = [ config::OUTPUT_DIR.to_string(), - // Legacy paths for backward compatibility during migration - "/Users/accusys/momentry/output".to_string(), ]; for output_dir in &output_dirs {