From 87dead7f6565272fa6c3638fed264e7911df9374 Mon Sep 17 00:00:00 2001 From: Accusys Date: Mon, 25 May 2026 10:50:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20POST=20/api/v1/jobs=20500=20=E2=80=94=20?= =?UTF-8?q?wrong=20column=20names=20+=20NULL=20file=5Fname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/processing.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/processing.rs b/src/api/processing.rs index 3c60a42..4ef2f66 100644 --- a/src/api/processing.rs +++ b/src/api/processing.rs @@ -426,7 +426,7 @@ async fn get_progress(file_uuid: Path) -> Result, })) } -async fn list_jobs(Query(params): Query) -> Result, StatusCode> { +async fn list_jobs(Json(params): Json) -> Result, StatusCode> { let pg = PostgresDb::init() .await .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; @@ -452,7 +452,7 @@ async fn list_jobs(Query(params): Query) -> Result, i32, i32)> = sqlx::query_as(&format!( - "SELECT j.id::int, j.uuid, v.file_name, COALESCE(j.status, 'QUEUED'), COALESCE(j.current_processor, ''), v.file_uuid, COALESCE(j.processed_frames, 0), COALESCE(j.total_frames, 0) \ + "SELECT j.id::int, j.uuid, COALESCE(v.file_name, ''), COALESCE(j.status, 'QUEUED'), COALESCE(j.current_processor, ''), v.file_uuid, COALESCE(j.progress_current, 0), COALESCE(j.progress_total, 0) \ FROM {} j LEFT JOIN {} v ON v.file_uuid = j.uuid{} \ ORDER BY j.id DESC LIMIT $1 OFFSET $2", jobs_table, videos_table, where_clause @@ -497,7 +497,7 @@ async fn get_job(Path(uuid): Path) -> Result, St let job: Option<(i32, String, String, String, Option, i32, i32, String, Option, Option)> = sqlx::query_as(&format!( "SELECT j.id::int, j.uuid, COALESCE(v.file_name, 'unknown'), COALESCE(j.status, 'QUEUED'), j.current_processor, \ - COALESCE(j.processed_frames, 0), COALESCE(j.total_frames, 0), \ + COALESCE(j.progress_current, 0), COALESCE(j.progress_total, 0), \ COALESCE(j.created_at::text, ''), j.started_at::text, j.updated_at::text \ FROM {} j LEFT JOIN {} v ON v.file_uuid = j.uuid WHERE j.uuid = $1", jobs_table, videos_table