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:?}");
|
||||
|
||||
let song = &resp.data[0];
|
||||
let url = format!("{app_base_url}/api/v2/coverart");
|
||||
let payload = serde_json::json!({
|
||||
"song_id": &song.id,
|
||||
"coverart_queue_id": &coverart_queue_id,
|
||||
});
|
||||
println!("Payload: {payload:?}");
|
||||
println!("Url: {url:?}");
|
||||
// println!("Response json: {:?}", response.text().await);
|
||||
Ok(())
|
||||
match the_rest::create_coverart::create(app_base_url, &song.id, &coverart_queue_id).await {
|
||||
Ok(response) => match response.json::<the_rest::create_coverart::response::Response>().await {
|
||||
Ok(resp) => {
|
||||
println!("CoverArt sent and successfully parsed response");
|
||||
println!("json: {resp:?}");
|
||||
Ok(())
|
||||
}
|
||||
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