fix: add status/duration/fps to FileDetailResponse; fix progress API with HSET+HGETALL
This commit is contained in:
@@ -155,6 +155,9 @@ pub struct FileDetailResponse {
|
||||
pub file_uuid: String,
|
||||
pub file_name: String,
|
||||
pub file_path: String,
|
||||
pub status: String,
|
||||
pub duration: f64,
|
||||
pub fps: f64,
|
||||
pub metadata: Option<serde_json::Value>,
|
||||
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
|
||||
}
|
||||
@@ -175,6 +178,9 @@ async fn get_file_detail(
|
||||
file_uuid: f.file_uuid,
|
||||
file_name: f.file_name,
|
||||
file_path: f.file_path,
|
||||
status: f.status.as_str().to_string(),
|
||||
duration: f.duration,
|
||||
fps: f.fps,
|
||||
metadata: f.probe_json,
|
||||
created_at: chrono::DateTime::parse_from_rfc3339(&f.created_at)
|
||||
.ok()
|
||||
@@ -745,19 +751,19 @@ async fn list_resources(
|
||||
.await
|
||||
.map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, e.to_string()))?;
|
||||
|
||||
let data: Vec<ResourceItem> = records
|
||||
.into_iter()
|
||||
.map(|r| ResourceItem {
|
||||
resource_id: r.resource_id,
|
||||
resource_type: r.resource_type,
|
||||
category: r.category,
|
||||
capabilities: r.capabilities,
|
||||
config: r.config,
|
||||
metadata: r.metadata,
|
||||
status: r.status,
|
||||
last_heartbeat: r.last_heartbeat,
|
||||
})
|
||||
.collect();
|
||||
let data: Vec<ResourceItem> = records
|
||||
.into_iter()
|
||||
.map(|r| ResourceItem {
|
||||
resource_id: r.resource_id,
|
||||
resource_type: r.resource_type,
|
||||
category: r.category,
|
||||
capabilities: r.capabilities,
|
||||
config: r.config,
|
||||
metadata: r.metadata,
|
||||
status: r.status,
|
||||
last_heartbeat: r.last_heartbeat,
|
||||
})
|
||||
.collect();
|
||||
|
||||
Ok(Json(ResourceResponse {
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user