Get queued coverart data #26
20
src/main.rs
20
src/main.rs
@@ -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,6 +96,13 @@ 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);
|
||||
|
||||
// TODO: Apply metadata to the queued song (modifying file)
|
||||
// TODO: Update the queued song with the updated queued song
|
||||
// TODO: Create song
|
||||
// TODO: Create coverart
|
||||
// TODO: Wipe data from queued song
|
||||
// TODO: Wipe data from queued coverart
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("Error: {:?}", err);
|
||||
@@ -105,12 +112,6 @@ async fn process_song(api_url: &String, song_queue_id: &uuid::Uuid) -> Result<()
|
||||
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
|
||||
// TODO: Create coverart
|
||||
// TODO: Wipe data from queued song
|
||||
// TODO: Wipe data from queued coverart
|
||||
}
|
||||
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);
|
||||
|
Reference in New Issue
Block a user