Calling the_rest::create_coverart::create()
This commit is contained in:
24
src/main.rs
24
src/main.rs
@@ -111,15 +111,21 @@ async fn some_work(
|
|||||||
println!("Response: {resp:?}");
|
println!("Response: {resp:?}");
|
||||||
|
|
||||||
let song = &resp.data[0];
|
let song = &resp.data[0];
|
||||||
let url = format!("{app_base_url}/api/v2/coverart");
|
match the_rest::create_coverart::create(app_base_url, &song.id, &coverart_queue_id).await {
|
||||||
let payload = serde_json::json!({
|
Ok(response) => match response.json::<the_rest::create_coverart::response::Response>().await {
|
||||||
"song_id": &song.id,
|
Ok(resp) => {
|
||||||
"coverart_queue_id": &coverart_queue_id,
|
println!("CoverArt sent and successfully parsed response");
|
||||||
});
|
println!("json: {resp:?}");
|
||||||
println!("Payload: {payload:?}");
|
Ok(())
|
||||||
println!("Url: {url:?}");
|
}
|
||||||
// println!("Response json: {:?}", response.text().await);
|
Err(err) => {
|
||||||
Ok(())
|
Err(std::io::Error::other(err.to_string()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(err) => {
|
||||||
|
Err(std::io::Error::other(err.to_string()))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Err(err) => Err(std::io::Error::other(err.to_string())),
|
Err(err) => Err(std::io::Error::other(err.to_string())),
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user