Updated dependencies (#48)

* Updated dependencies

* Saving changes

* More changes

* More changes

* Updated dependencies

* Updated readme

* Saving changes

* Cleanup
This commit was merged in pull request #48.
This commit is contained in:
KD
2025-04-03 23:16:37 -04:00
committed by GitHub
parent 885f1db3af
commit d5f95ddf9b
10 changed files with 49 additions and 48 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
use crate::models;
pub fn retrieve_url(api: &models::api::API, with_id: bool, id: i32) -> String {
pub fn retrieve_url(api: &models::api::API, with_id: bool, id: &uuid::Uuid) -> String {
if with_id {
retrieve_url_with_id(&api, id)
} else {
@@ -10,6 +10,7 @@ pub fn retrieve_url(api: &models::api::API, with_id: bool, id: i32) -> String {
fn retrieve_url_reg(api: &models::api::API) -> String {
let mut url: String = String::from(&api.url);
url += &String::from("/");
url += &String::from("api/");
url += &String::from(&api.version);
url += &String::from("/");
@@ -19,7 +20,7 @@ fn retrieve_url_reg(api: &models::api::API) -> String {
return url;
}
fn retrieve_url_with_id(api: &models::api::API, id: i32) -> String {
fn retrieve_url_with_id(api: &models::api::API, id: &uuid::Uuid) -> String {
let mut url: String = String::from(&api.url);
url += &String::from("api/");
url += &String::from(&api.version);
+1 -1
View File
@@ -25,7 +25,7 @@ impl Delete {
song: &icarus_models::song::Song,
) -> Result<icarus_models::song::Song, std::io::Error> {
self.api.endpoint = "song/data/delete".to_owned();
let url = syncers::common::retrieve_url(&self.api, true, song.id);
let url = syncers::common::retrieve_url(&self.api, true, &song.id);
let client = reqwest::Client::builder().build().unwrap();
let access_token = token.bearer_token();
let response = client
+3 -1
View File
@@ -28,9 +28,11 @@ impl Download {
song: &icarus_models::song::Song,
) -> Result<String, MyError> {
self.api.endpoint = String::from("song/data/download");
let url = syncers::common::retrieve_url(&self.api, true, song.id);
let url = syncers::common::retrieve_url(&self.api, true, &song.id);
let access_token = token.bearer_token();
println!("Url: {:?}", url);
let client = reqwest::Client::builder().build().unwrap();
match client
+1 -1
View File
@@ -22,7 +22,7 @@ impl RetrieveRecords {
token: &icarus_models::token::AccessToken,
) -> Result<Vec<icarus_models::song::Song>, Error> {
self.api.endpoint = String::from("song");
let url = syncers::common::retrieve_url(&self.api, false, 0);
let url = syncers::common::retrieve_url(&self.api, false, &uuid::Uuid::nil());
let access_token = token.bearer_token();
let client = reqwest::Client::builder().build().unwrap();
+1 -1
View File
@@ -26,7 +26,7 @@ impl Upload {
cover: &icarus_models::coverart::CoverArt,
) -> Result<reqwest::Response, reqwest::Error> {
self.api.endpoint = String::from("song/data/upload/with/data");
let url = syncers::common::retrieve_url(&self.api, false, 0);
let url = syncers::common::retrieve_url(&self.api, false, &uuid::Uuid::nil());
let access_token = token.bearer_token();
if url.is_empty() {