Delete song (#67)
* Changed code to comply with async * Able to delete song * Updated readme * Code formatting and cleanup * Version bump
This commit was merged in pull request #67.
This commit is contained in:
@@ -5,7 +5,6 @@ use std::io::{Result, Write};
|
||||
use std::str::FromStr;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::runtime::Runtime;
|
||||
|
||||
use crate::managers;
|
||||
use crate::models::{self};
|
||||
@@ -169,11 +168,9 @@ impl CommitManager {
|
||||
|
||||
println!("Deleting song..");
|
||||
|
||||
let res_fut = del.delete_song(&token, &song);
|
||||
let result = Runtime::new().unwrap().block_on(res_fut);
|
||||
match result {
|
||||
Ok(o) => {
|
||||
println!("Song (Id {:?}) has been successfully deleted", o.id);
|
||||
match del.delete_song(&token, &song).await {
|
||||
Ok((song, _coverart)) => {
|
||||
println!("Song (Id {:?}) has been successfully deleted", song.id);
|
||||
}
|
||||
Err(er) => {
|
||||
println!("Error {er:?}");
|
||||
|
||||
Reference in New Issue
Block a user