Code formatting

This commit is contained in:
kdeng00
2025-07-28 17:01:17 -04:00
parent 0984cc600f
commit 03d9f649e4
2 changed files with 19 additions and 13 deletions
+13 -11
View File
@@ -647,10 +647,10 @@ pub mod endpoint {
} }
} }
pub async fn download_coverart(axum::Extension(pool): axum::Extension<sqlx::PgPool>, pub async fn download_coverart(
axum::extract::Path(id): axum::extract::Path<uuid::Uuid>) -> axum::Extension(pool): axum::Extension<sqlx::PgPool>,
(axum::http::StatusCode, axum::response::Response) { axum::extract::Path(id): axum::extract::Path<uuid::Uuid>,
) -> (axum::http::StatusCode, axum::response::Response) {
match super::cov_db::get_coverart(&pool, &id).await { match super::cov_db::get_coverart(&pool, &id).await {
Ok(coverart) => match coverart.to_data() { Ok(coverart) => match coverart.to_data() {
Ok(data) => { Ok(data) => {
@@ -671,13 +671,15 @@ pub mod endpoint {
(axum::http::StatusCode::OK, response) (axum::http::StatusCode::OK, response)
} }
Err(_err) => { Err(_err) => (
(axum::http::StatusCode::NOT_FOUND, axum::response::Response::default()) axum::http::StatusCode::NOT_FOUND,
} axum::response::Response::default(),
} ),
Err(_err) => { },
(axum::http::StatusCode::NOT_FOUND, axum::response::Response::default()) Err(_err) => (
} axum::http::StatusCode::NOT_FOUND,
axum::response::Response::default(),
),
} }
} }
} }
+6 -2
View File
@@ -123,7 +123,10 @@ pub mod init {
crate::callers::endpoints::GETCOVERART, crate::callers::endpoints::GETCOVERART,
get(crate::callers::coverart::endpoint::get_coverart), get(crate::callers::coverart::endpoint::get_coverart),
) )
.route(crate::callers::endpoints::DOWNLOADCOVERART, get(crate::callers::coverart::endpoint::download_coverart)) .route(
crate::callers::endpoints::DOWNLOADCOVERART,
get(crate::callers::coverart::endpoint::download_coverart),
)
.route( .route(
crate::callers::endpoints::STREAMSONG, crate::callers::endpoints::STREAMSONG,
get(crate::callers::song::endpoint::stream_song), get(crate::callers::song::endpoint::stream_song),
@@ -2085,7 +2088,8 @@ mod tests {
let id = test_data::coverart_id().await.unwrap(); let id = test_data::coverart_id().await.unwrap();
let uri = let uri =
super::format_url_with_value(crate::callers::endpoints::DOWNLOADCOVERART, &id).await; super::format_url_with_value(crate::callers::endpoints::DOWNLOADCOVERART, &id)
.await;
match app match app
.clone() .clone()