From 76c52f12fcac9f7acd68b21c8e130f1a594f6578 Mon Sep 17 00:00:00 2001 From: Accusys Date: Mon, 5 Oct 2026 04:13:19 +0800 Subject: [PATCH] fix: file_uuid format + ffprobe path **Fixes**: 1. file_uuid: Use standard format with hyphens (consistent with other 11 places) - Changed from simple().to_string() to to_string() - Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 2. ffprobe: Use FFPROBE_PATH environment variable - Fallback to 'ffprobe' in PATH - Follows project convention (DATABASE_URL, AUDIT_ENCRYPTION_KEY) - Solves non-interactive PATH issue **Rationale**: - Both are one-line changes - Reduces packaging cycles (avoiding 4th binary sync issue) - Critical for data consistency and deployment automation --- src/core/probe/ffprobe.rs | 5 ++++- src/main.rs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/probe/ffprobe.rs b/src/core/probe/ffprobe.rs index 1ece4d99..ba9f082b 100644 --- a/src/core/probe/ffprobe.rs +++ b/src/core/probe/ffprobe.rs @@ -34,7 +34,10 @@ pub struct FormatInfo { } pub fn probe_video(video_path: &str) -> Result { - let output = Command::new("ffprobe") + // Use FFPROBE_PATH environment variable, fallback to "ffprobe" + let ffprobe_path = std::env::var("FFPROBE_PATH").unwrap_or_else(|_| "ffprobe".to_string()); + + let output = Command::new(&ffprobe_path) .args([ "-v", "quiet", diff --git a/src/main.rs b/src/main.rs index 0dec3b7a..542931de 100644 --- a/src/main.rs +++ b/src/main.rs @@ -165,8 +165,8 @@ async fn handle_register(path: &str) -> Result<()> { anyhow::bail!("File not found: {}", path); } - // 產生 file_uuid (Uuid::new_v4()) - let file_uuid = Uuid::new_v4().simple().to_string(); + // 產生 file_uuid (Uuid::new_v4(),標準格式帶連字號) + let file_uuid = Uuid::new_v4().to_string(); println!("Generated UUID: {}", file_uuid); // ffprobe 提取 metadata