Updated icarus-model (#33)

* Updated icarus-model

* Updated icarus-model

* Saving changes

* Code formatting

* Removing code

* Updated icarus-model

* Updated token secret

* Added host

* Fix build issue

* Fix build warnings

* Saving changes

* Saving changes

* Refactoring

* Migrating over icarus-model coverart

* Removed song module

* Another one

* Meta single upload is functional

* Cleanup

* More cleanup

* Added test files (#37)

* Added test files

Need to add a coverarg image file

* Updated test album file

* Added coverart

* Uploading meta is operational

* Code cleanup

* Moved function

* Added string module
This commit was merged in pull request #33.
This commit is contained in:
KD
2025-03-24 19:34:38 -04:00
committed by GitHub
parent de90b0d0a1
commit 64935ea772
16 changed files with 303 additions and 458 deletions
+6 -6
View File
@@ -21,8 +21,8 @@ impl Delete {
pub async fn delete_song(
&mut self,
token: &icarus_models::token::AccessToken,
song: &models::song::Song,
) -> Result<models::song::Song, std::io::Error> {
song: &icarus_models::song::Song,
) -> Result<icarus_models::song::Song, std::io::Error> {
self.api.endpoint = "song/data/delete".to_owned();
let url = self.retrieve_url(&song);
let client = reqwest::Client::builder().build().unwrap();
@@ -33,12 +33,12 @@ impl Delete {
.send()
.await
.unwrap();
let mut sng = models::song::Song::default();
let mut sng = icarus_models::song::Song::default();
match response.status() {
reqwest::StatusCode::OK => {
println!("Success!");
let s = response.json::<models::song::Song>().await;
let s = response.json::<icarus_models::song::Song>().await;
match s {
//
Ok(parsed) => {
@@ -57,7 +57,7 @@ impl Delete {
return Ok(sng);
}
fn retrieve_url(&self, song: &models::song::Song) -> String {
fn retrieve_url(&self, song: &icarus_models::song::Song) -> String {
let api = &self.api;
let mut url: String = String::from(&api.url);
url += &String::from("api/");
@@ -65,7 +65,7 @@ impl Delete {
url += &String::from("/");
url += &String::from(&api.endpoint);
url += &String::from("/");
url += &song.id.unwrap().to_string();
url += &song.id.to_string();
return url;
}