Get queued coverart data #26

Merged
phoenix merged 7 commits from queued_coverart_data into devel 2025-06-19 00:54:14 +00:00
Showing only changes of commit 1945c2357f - Show all commits

View File

@@ -88,7 +88,7 @@ async fn process_song(api_url: &String, song_queue_id: &uuid::Uuid) -> Result<()
Ok(response) => {
let coverart_queue_id = &response.data[0].id;
println!("Coverart queue Id: {:?}", coverart_queue_id);
// TODO: Get queued coverart's data
match api::get_coverart_queue::get_data(api_url, &coverart_queue_id).await {
Ok(response) => match api::parsing::parse_response_into_bytes(response).await {
Ok(coverart_queue_bytes) => {
@@ -96,15 +96,7 @@ async fn process_song(api_url: &String, song_queue_id: &uuid::Uuid) -> Result<()
let save_path = save_file_to_fs(&directory, &filename, &coverart_queue_bytes).await;
println!("Saved coverart queue file at: {:?}", save_path);
}
Err(err) => {
eprintln!("Error: {:?}", err);
}
}
Err(err) => {
eprintln!("Error: {:?}", err);
}
}
// TODO: Apply metadata to the queued song (modifying file)
// TODO: Update the queued song with the updated queued song
// TODO: Create song
@@ -116,6 +108,15 @@ async fn process_song(api_url: &String, song_queue_id: &uuid::Uuid) -> Result<()
eprintln!("Error: {:?}", err);
}
}
Err(err) => {
eprintln!("Error: {:?}", err);
}
}
}
Err(err) => {
eprintln!("Error: {:?}", err);
}
}
}
Err(err) => {
eprintln!("Error: {:?}", err);
@@ -325,7 +326,10 @@ mod api {
.await
}
pub async fn get_data(base_url: &String, coverart_queue_id: &uuid::Uuid) -> Result<reqwest::Response, reqwest::Error> {
pub async fn get_data(
base_url: &String,
coverart_queue_id: &uuid::Uuid,
) -> Result<reqwest::Response, reqwest::Error> {
let client = reqwest::Client::new();
let endpoint = String::from("api/v2/coverart/queue/data");
let api_url = format!("{}/{}/{}", base_url, endpoint, coverart_queue_id);