Cleanup
pr CI / Test Suite (pull_request) Failing after 2m40s

This commit is contained in:
2026-08-14 07:03:17 -04:00
parent cfb5487585
commit c28b6b8255
2 changed files with 159 additions and 6 deletions
+56 -6
View File
@@ -178,14 +178,64 @@ pub mod endpoint {
file_type
);
match repo::coverart::insert(&pool, &raw_data, &file_type.file_type).await {
Ok(id) => {
response.message = String::from("Successful");
response.data.push(id);
(axum::http::StatusCode::OK, axum::Json(response))
let lab_config = crate::util::maze::get_config();
let lr = labyrinth::Labyrinth { config: lab_config };
let data = labyrinth::Data {
raw_data: raw_data,
..Default::default()
};
let filename = simodels::coverart::generate_filename(
simodels::types::CoverArtType::JpegExtension,
true,
)
.unwrap();
let file_path = format!("queued/coverart/{filename}");
println!("Key: {file_path:?}");
match lr.upload(&file_path, &data).await {
Ok(_res) => {
match repo::coverart::insert(
&pool,
&data.raw_data,
&file_type.file_type,
)
.await
{
Ok(id) => {
match repo::data::insert(
&pool,
&file_path,
&lr.config.bucket,
&lr.config.region,
&id,
)
.await
{
Ok(_id) => {
response.message = String::from("Successful");
response.data.push(id);
(axum::http::StatusCode::OK, axum::Json(response))
}
Err(err) => {
response.message = err.to_string();
(
axum::http::StatusCode::BAD_REQUEST,
axum::Json(response),
)
}
}
}
Err(err) => {
response.message = err.to_string();
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
}
}
}
Err(err) => {
response.message = err.to_string();
eprintln!("Error: {err:?}");
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
}
}