fix: scan extensions add jpg/png, /files status from DB (2/4 M4 items)

This commit is contained in:
Accusys
2026-05-13 20:43:37 +08:00
parent 50d38a5473
commit 2e7dd44552
3 changed files with 6 additions and 6 deletions

View File

@@ -42,6 +42,7 @@ pub struct FileRecord {
pub file_uuid: String,
pub file_path: String,
pub file_name: String,
pub status: Option<String>,
pub probe_json: Option<serde_json::Value>,
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
}
@@ -2358,7 +2359,7 @@ impl PostgresDb {
pub async fn list_files(&self, limit: i32, offset: i64) -> Result<Vec<FileRecord>> {
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<Option<FileRecord>> {
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)