Update queued song status #63

Merged
kdeng00 merged 5 commits from update_queued_song_status into upload_song 2025-08-28 18:41:46 -04:00
2 changed files with 20 additions and 10 deletions
Showing only changes of commit dd245b1999 - Show all commits
+5 -2
View File
@@ -458,7 +458,10 @@ impl CommitManager {
.link_queued_song_to_queued_coverart(token, &queued_song_id, &id)
.await
{
Ok(_) => match up.update_queued_song_status(token, &queued_song_id, "ready").await {
Ok(_) => match up
.update_queued_song_status(token, &queued_song_id, "ready")
.await
{
Ok(_) => {
println!("Queued coverart Id: {id:?}");
println!("Linked queued song to queued coverart");
@@ -467,7 +470,7 @@ impl CommitManager {
Err(err) => {
return Err(std::io::Error::other(err.to_string()));
}
}
},
Err(err) => {
return Err(std::io::Error::other(err.to_string()));
}
+15 -8
View File
@@ -300,7 +300,12 @@ impl Upload {
}
}
pub async fn update_queued_song_status(&self, token: &icarus_models::token::AccessToken, queued_song_id: &uuid::Uuid, status: &str) -> Result<(), reqwest::Error> {
pub async fn update_queued_song_status(
&self,
token: &icarus_models::token::AccessToken,
queued_song_id: &uuid::Uuid,
status: &str,
) -> Result<(), reqwest::Error> {
let endpoint = String::from("api/v2/song/queue");
let url = format!("{}/{endpoint}", self.api.url);
@@ -315,13 +320,15 @@ impl Upload {
let client = reqwest::Client::builder().build().unwrap();
match client.patch(url).headers(headers).json(&payload).send().await {
Ok(_) => {
Ok(())
}
Err(err) => {
Err(err)
}
match client
.patch(url)
.headers(headers)
.json(&payload)
.send()
.await
{
Ok(_) => Ok(()),
Err(err) => Err(err),
}
}