From 26147ed0b6afcdaaca07bb87dc78bfe354303fad Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 22 Jul 2025 21:03:15 -0400 Subject: [PATCH 1/3] Removing hard coded user_id --- src/main.rs | 6 ++++-- src/responses.rs | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d2907db..7a6682f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,9 +21,10 @@ async fn main() -> Result<(), Box> { println!("Queue is not empty"); println!("SongQueueItem: {song_queue_item:?}"); let song_queue_id = song_queue_item.data[0].id; + let user_id = song_queue_item.data[0].user_id; // TODO: Do something with the result later - match some_work(&app_base_url, &song_queue_id).await { + match some_work(&app_base_url, &song_queue_id, &user_id).await { Ok(( _song, _coverart, @@ -125,6 +126,7 @@ async fn is_queue_empty( async fn some_work( app_base_url: &String, song_queue_id: &uuid::Uuid, + user_id: &uuid::Uuid, ) -> Result< ( icarus_models::song::Song, @@ -155,7 +157,7 @@ async fn some_work( // TODO: Do not hard code this. Check if one of the existing // endpoints already have the user_id - let user_id = uuid::Uuid::new_v4(); + // let user_id = uuid::Uuid::new_v4(); // TODO: Place this somewhere else let song_type = String::from("flac"); // Err(std::io::Error::other(err.to_string())) diff --git a/src/responses.rs b/src/responses.rs index c5a090e..3f990a5 100644 --- a/src/responses.rs +++ b/src/responses.rs @@ -6,6 +6,7 @@ pub mod fetch_next_queue_item { pub id: uuid::Uuid, pub filename: String, pub status: String, + pub user_id: uuid::Uuid, } #[derive(Debug, Deserialize, Serialize)] -- 2.43.0 From e67139bb3b660d113c2cb1dc75bff5dbfb7e039b Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 22 Jul 2025 21:05:58 -0400 Subject: [PATCH 2/3] Warning fix --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7a6682f..f1169f9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -164,7 +164,7 @@ async fn some_work( match the_rest::create_song::create( app_base_url, &metadata, - &user_id, + user_id, &song_type, ) .await -- 2.43.0 From 3dc4210b0b3528bc737b94c2bce7241a0156fd03 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 22 Jul 2025 21:15:14 -0400 Subject: [PATCH 3/3] Cleanup --- src/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index f1169f9..aef13f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -155,12 +155,9 @@ async fn some_work( Ok(_inner_response) => { println!("Response: {_inner_response:?}"); - // TODO: Do not hard code this. Check if one of the existing - // endpoints already have the user_id - // let user_id = uuid::Uuid::new_v4(); // TODO: Place this somewhere else let song_type = String::from("flac"); - // Err(std::io::Error::other(err.to_string())) + match the_rest::create_song::create( app_base_url, &metadata, -- 2.43.0