feat: add is_registered field to FileItem API
- Add is_registered field to FileItem struct - Set is_registered based on status != 'pending' - Fixes Library card display issue (frontend expects is_registered field) Related: FaceNet CoreML integration testing completed successfully
This commit is contained in:
@@ -109,11 +109,14 @@ async fn list_files(
|
|||||||
.await
|
.await
|
||||||
.unwrap_or(0);
|
.unwrap_or(0);
|
||||||
|
|
||||||
|
let is_registered = v.status.as_str() != "pending";
|
||||||
|
|
||||||
vec![FileItem {
|
vec![FileItem {
|
||||||
file_uuid: v.file_uuid,
|
file_uuid: v.file_uuid,
|
||||||
file_name: v.file_name,
|
file_name: v.file_name,
|
||||||
file_path: v.file_path,
|
file_path: v.file_path,
|
||||||
status: v.status.as_str().to_string(),
|
status: v.status.as_str().to_string(),
|
||||||
|
is_registered,
|
||||||
total_chunks: chunk_count,
|
total_chunks: chunk_count,
|
||||||
}]
|
}]
|
||||||
} else {
|
} else {
|
||||||
@@ -148,6 +151,7 @@ async fn list_files(
|
|||||||
file_name: r.file_name,
|
file_name: r.file_name,
|
||||||
file_path: r.file_path,
|
file_path: r.file_path,
|
||||||
status: r.status.as_str().to_string(),
|
status: r.status.as_str().to_string(),
|
||||||
|
is_registered: r.status.as_str() != "pending",
|
||||||
total_chunks: 0,
|
total_chunks: 0,
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
@@ -201,6 +205,7 @@ pub struct FileItem {
|
|||||||
pub file_name: String,
|
pub file_name: String,
|
||||||
pub file_path: String,
|
pub file_path: String,
|
||||||
pub status: String,
|
pub status: String,
|
||||||
|
pub is_registered: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub total_chunks: i64,
|
pub total_chunks: i64,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user