YTShortMakerArchx commited on
Commit
c8e2847
·
verified ·
1 Parent(s): 1e0e692

Update main.rs

Browse files
Files changed (1) hide show
  1. main.rs +4 -5
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
- response_obj["duplicate_warning"] = warning;
416
  }
417
 
418
- Ok((StatusCode::OK, Json(response_obj)))
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) {