diff --git a/src/api/identity_api.rs b/src/api/identity_api.rs index ec59da5..372e6f5 100644 --- a/src/api/identity_api.rs +++ b/src/api/identity_api.rs @@ -94,7 +94,7 @@ async fn list_files( file_uuid: r.file_uuid, file_name: r.file_name, file_path: r.file_path, - status: "ready".to_string(), // Hardcoded for now + status: r.status.unwrap_or_default(), }) .collect(); diff --git a/src/api/server.rs b/src/api/server.rs index 0bb680c..83095ed 100644 --- a/src/api/server.rs +++ b/src/api/server.rs @@ -1891,7 +1891,7 @@ async fn scan_files(State(state): State) -> Result, pub probe_json: Option, pub created_at: Option>, } @@ -2358,7 +2359,7 @@ impl PostgresDb { pub async fn list_files(&self, limit: i32, offset: i64) -> Result> { let query = r#" - SELECT file_uuid, file_path, file_name, probe_json, created_at + SELECT file_uuid, file_path, file_name, status, probe_json, created_at FROM videos ORDER BY created_at DESC LIMIT $1 OFFSET $2 @@ -2375,9 +2376,8 @@ impl PostgresDb { pub async fn get_file_by_uuid(&self, uuid: &str) -> Result> { let query = r#" - SELECT file_uuid, file_path, file_name, probe_json, created_at - FROM videos - WHERE file_uuid = $1 + SELECT file_uuid, file_path, file_name, status, probe_json, created_at + FROM videos WHERE file_uuid = $1 "#; let row = sqlx::query_as(query)