tsk-209: Code formatting
This commit is contained in:
+19
-13
@@ -210,7 +210,8 @@ pub mod endpoint {
|
|||||||
file_type
|
file_type
|
||||||
);
|
);
|
||||||
|
|
||||||
match repo_queue::coverart::insert(&pool, &raw_data, &file_type.file_type).await {
|
match repo_queue::coverart::insert(&pool, &raw_data, &file_type.file_type).await
|
||||||
|
{
|
||||||
Ok(id) => {
|
Ok(id) => {
|
||||||
response.message = String::from("Successful");
|
response.message = String::from("Successful");
|
||||||
response.data.push(id);
|
response.data.push(id);
|
||||||
@@ -310,8 +311,11 @@ pub mod endpoint {
|
|||||||
},
|
},
|
||||||
_ => match params.song_queue_id {
|
_ => match params.song_queue_id {
|
||||||
Some(song_queue_id) => {
|
Some(song_queue_id) => {
|
||||||
match repo_queue::coverart::get_coverart_queue_with_song_queue_id(&pool, &song_queue_id)
|
match repo_queue::coverart::get_coverart_queue_with_song_queue_id(
|
||||||
.await
|
&pool,
|
||||||
|
&song_queue_id,
|
||||||
|
)
|
||||||
|
.await
|
||||||
{
|
{
|
||||||
Ok(cover_art_queue) => {
|
Ok(cover_art_queue) => {
|
||||||
response.message = String::from("Successful");
|
response.message = String::from("Successful");
|
||||||
@@ -477,17 +481,19 @@ pub mod endpoint {
|
|||||||
let coverart_queue_id = payload.coverart_queue_id;
|
let coverart_queue_id = payload.coverart_queue_id;
|
||||||
|
|
||||||
match repo_queue::coverart::get_coverart_queue_with_id(&pool, &coverart_queue_id).await {
|
match repo_queue::coverart::get_coverart_queue_with_id(&pool, &coverart_queue_id).await {
|
||||||
Ok(coverart_queue) => match repo_queue::coverart::wipe_data(&pool, &coverart_queue.id).await {
|
Ok(coverart_queue) => {
|
||||||
Ok(id) => {
|
match repo_queue::coverart::wipe_data(&pool, &coverart_queue.id).await {
|
||||||
response.message = String::from("Success");
|
Ok(id) => {
|
||||||
response.data.push(id);
|
response.message = String::from("Success");
|
||||||
(axum::http::StatusCode::OK, axum::Json(response))
|
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) => {
|
Err(err) => {
|
||||||
response.message = err.to_string();
|
response.message = err.to_string();
|
||||||
(axum::http::StatusCode::NOT_FOUND, axum::Json(response))
|
(axum::http::StatusCode::NOT_FOUND, axum::Json(response))
|
||||||
|
|||||||
+2
-8
@@ -830,9 +830,7 @@ pub mod endpoint {
|
|||||||
|
|
||||||
match repo::song::get_song(&pool, &id).await {
|
match repo::song::get_song(&pool, &id).await {
|
||||||
Ok(song) => {
|
Ok(song) => {
|
||||||
match repo::coverart::get_coverart_with_song_id(&pool, &song.id)
|
match repo::coverart::get_coverart_with_song_id(&pool, &song.id).await {
|
||||||
.await
|
|
||||||
{
|
|
||||||
Ok(coverart) => {
|
Ok(coverart) => {
|
||||||
let coverart_path_str = match coverart.get_path() {
|
let coverart_path_str = match coverart.get_path() {
|
||||||
Ok(path) => path,
|
Ok(path) => path,
|
||||||
@@ -849,11 +847,7 @@ pub mod endpoint {
|
|||||||
if coverart_path.exists() {
|
if coverart_path.exists() {
|
||||||
match repo::song::delete_song(&pool, &song.id).await {
|
match repo::song::delete_song(&pool, &song.id).await {
|
||||||
Ok(deleted_song) => {
|
Ok(deleted_song) => {
|
||||||
match repo::coverart::delete_coverart(
|
match repo::coverart::delete_coverart(&pool, &coverart.id).await
|
||||||
&pool,
|
|
||||||
&coverart.id,
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
{
|
{
|
||||||
Ok(deleted_coverart) => {
|
Ok(deleted_coverart) => {
|
||||||
match song.remove_from_filesystem() {
|
match song.remove_from_filesystem() {
|
||||||
|
|||||||
Reference in New Issue
Block a user