From 9d0f85c0480702d3babde21a6a85030d05caabb2 Mon Sep 17 00:00:00 2001 From: Accusys Date: Fri, 9 Oct 2026 21:43:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20GET=20/file-profile?= =?UTF-8?q?=20=E4=B8=AD=E7=9A=84=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复内容: - width: i32 → u32 - height: i32 → u32 - total_frames: i64 → u64 - db_face_filter: 移动语义改为克隆 原因: - 数据库查询返回 i32/i64 - FileProfile::from_db_record 需要 u32/u64 测试: - ✅ 编译通过 - ✅ 自动迁移成功 - ✅ 数据完整 Git: 1379cf59 (fix) --- src/api/profile.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/api/profile.rs b/src/api/profile.rs index 4c0dfb03..ebfa30a6 100644 --- a/src/api/profile.rs +++ b/src/api/profile.rs @@ -1044,7 +1044,8 @@ pub async fn get_file_profile_handler( .or_else(|| { // Fallback to database (backward compatibility) db_face_filter - .and_then(|v| serde_json::from_value::(v).ok()) + .as_ref() + .and_then(|v| serde_json::from_value::(v.clone()).ok()) }) .unwrap_or_else(FaceFilterSettings::defaults); @@ -1058,10 +1059,10 @@ pub async fn get_file_profile_handler( "video", "", duration, - width, - height, + width as u32, + height as u32, fps, - total_frames, + total_frames as u64, ); new_profile.face_filter = Some(face_filter.clone()); if let Err(e) = new_profile.save_to_disk(output_dir) {