Saving code
pr CI / Test Suite (pull_request) Failing after 3m10s

This commit is contained in:
2026-08-13 11:12:44 -04:00
parent 39c9e88d00
commit db8e5458ca
2 changed files with 66 additions and 11 deletions
+50 -11
View File
@@ -358,14 +358,7 @@ pub mod endpoint {
println!("Id: {song_queue_id}");
let lab_config = crate::util::maze::get_config();
let lr = labyrinth::Labyrinth { config: lab_config };
/*
let data = labyrinth::Data {
raw_data: copied_raw_data,
..Default::default()
};
*/
match repo::data::get_with_song_queue_id(&pool, &song_queue_id).await {
Ok((id, file_key, _bucket, _region, _)) => match lr.download(&file_key).await {
@@ -481,7 +474,7 @@ pub mod endpoint {
)
)]
pub async fn update_song_queue(
axum::extract::Path(id): axum::extract::Path<uuid::Uuid>,
axum::extract::Path(song_queue_id): axum::extract::Path<uuid::Uuid>,
axum::Extension(pool): axum::Extension<sqlx::PgPool>,
mut multipart: axum::extract::Multipart,
) -> (
@@ -512,15 +505,61 @@ pub mod endpoint {
match super::is_song_valid(&raw_data).await {
Ok(valid) => {
if valid {
match repo::song::update(&pool, &raw_data, &id).await {
Ok(_) => {
let lab_config = crate::util::maze::get_config();
let lr = labyrinth::Labyrinth { config: lab_config };
match repo::data::get_with_song_queue_id(&pool, &song_queue_id).await {
Ok((id, file_key, _bucket, _region, _)) => match lr.delete(&file_key).await {
Ok(_response) => {
let data = labyrinth::Data {
raw_data: raw_data,
..Default::default()
};
let filename = simodels::song::generate_filename(
simodels::types::MusicType::FlacExtension,
true,
)
.unwrap();
let new_file_key = format!("queued/song/{filename}");
match lr.upload(&new_file_key, &data).await {
Ok(_) => {
match repo::data::update_file_key(&pool, &song_queue_id, &new_file_key).await {
Ok(_) => {
response.message =
String::from(super::super::super::response::SUCCESSFUL);
response.data.push(id);
(axum::http::StatusCode::OK, axum::Json(response))
}
Err(err) => {
response.message = err.to_string();
(
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
axum::Json(response),
)
}
}
}
Err(err) => {
eprintln!("Error: {err:?}");
(
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
axum::Json(response),
)
}
}
}
Err(err) => {
eprintln!("Error: {err:?}");
(
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
axum::Json(response),
)
}
}
Err(err) => {
response.message = err.to_string();
eprintln!("Error: {err:?}");
(
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
axum::Json(response),