Update main.rs
Browse files
main.rs
CHANGED
|
@@ -327,7 +327,7 @@ async fn align_audio(
|
|
| 327 |
.map(|existing| {
|
| 328 |
serde_json::json!({
|
| 329 |
"message": "You already have an active job.",
|
| 330 |
-
"existing_job_id": existing.id,
|
| 331 |
"existing_status": existing.status.as_str(),
|
| 332 |
})
|
| 333 |
})
|
|
@@ -396,7 +396,7 @@ async fn align_audio(
|
|
| 396 |
});
|
| 397 |
}
|
| 398 |
|
| 399 |
-
let response = serde_json::json!({
|
| 400 |
"job_id": job_id,
|
| 401 |
"status": status.as_str(),
|
| 402 |
"queue_position": queue_position,
|
|
@@ -410,12 +410,11 @@ async fn align_audio(
|
|
| 410 |
},
|
| 411 |
});
|
| 412 |
|
| 413 |
-
let mut response_obj = response;
|
| 414 |
if let Some(warning) = duplicate_warning {
|
| 415 |
-
|
| 416 |
}
|
| 417 |
|
| 418 |
-
Ok((StatusCode::OK, Json(
|
| 419 |
}
|
| 420 |
|
| 421 |
async fn run_alignment(state: AppState, job_id: String) {
|
|
|
|
| 327 |
.map(|existing| {
|
| 328 |
serde_json::json!({
|
| 329 |
"message": "You already have an active job.",
|
| 330 |
+
"existing_job_id": existing.id.clone(),
|
| 331 |
"existing_status": existing.status.as_str(),
|
| 332 |
})
|
| 333 |
})
|
|
|
|
| 396 |
});
|
| 397 |
}
|
| 398 |
|
| 399 |
+
let mut response = serde_json::json!({
|
| 400 |
"job_id": job_id,
|
| 401 |
"status": status.as_str(),
|
| 402 |
"queue_position": queue_position,
|
|
|
|
| 410 |
},
|
| 411 |
});
|
| 412 |
|
|
|
|
| 413 |
if let Some(warning) = duplicate_warning {
|
| 414 |
+
response["duplicate_warning"] = warning;
|
| 415 |
}
|
| 416 |
|
| 417 |
+
Ok((StatusCode::OK, Json(response)))
|
| 418 |
}
|
| 419 |
|
| 420 |
async fn run_alignment(state: AppState, job_id: String) {
|