fix: 修复 GET /file-profile 中的类型转换问题

修复内容:
- width: i32 → u32
- height: i32 → u32
- total_frames: i64 → u64
- db_face_filter: 移动语义改为克隆

原因:
- 数据库查询返回 i32/i64
- FileProfile::from_db_record 需要 u32/u64

测试:
- ✅ 编译通过
- ✅ 自动迁移成功
- ✅ 数据完整

Git: 1379cf59 (fix)
This commit is contained in:
Accusys
2026-10-09 21:43:11 +08:00
parent 1379cf59cf
commit 9d0f85c048
+5 -4
View File
@@ -1044,7 +1044,8 @@ pub async fn get_file_profile_handler(
.or_else(|| { .or_else(|| {
// Fallback to database (backward compatibility) // Fallback to database (backward compatibility)
db_face_filter db_face_filter
.and_then(|v| serde_json::from_value::<FaceFilterSettings>(v).ok()) .as_ref()
.and_then(|v| serde_json::from_value::<FaceFilterSettings>(v.clone()).ok())
}) })
.unwrap_or_else(FaceFilterSettings::defaults); .unwrap_or_else(FaceFilterSettings::defaults);
@@ -1058,10 +1059,10 @@ pub async fn get_file_profile_handler(
"video", "video",
"", "",
duration, duration,
width, width as u32,
height, height as u32,
fps, fps,
total_frames, total_frames as u64,
); );
new_profile.face_filter = Some(face_filter.clone()); new_profile.face_filter = Some(face_filter.clone());
if let Err(e) = new_profile.save_to_disk(output_dir) { if let Err(e) = new_profile.save_to_disk(output_dir) {