Get Metadata queue #23

Merged
phoenix merged 5 commits from get_metedata_queue into devel 2025-06-14 00:30:26 +00:00
Showing only changes of commit c4a83ee149 - Show all commits

View File

@@ -42,7 +42,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("Saved at: {:?}", save_path);
match api::get_metadata_queue::get(&app_base_url, &song_queue_id).await {
match api::get_metadata_queue::get(
&app_base_url,
&song_queue_id,
)
.await
{
Ok(response) => {
match response.json::<api::get_metadata_queue::response::Response>().await {
Ok(response) => {
@@ -182,11 +187,18 @@ mod api {
}
pub mod get_metadata_queue {
pub async fn get(base_url: &String, song_queue_id: &uuid::Uuid) -> Result<reqwest::Response, reqwest::Error> {
pub async fn get(
base_url: &String,
song_queue_id: &uuid::Uuid,
) -> Result<reqwest::Response, reqwest::Error> {
let client = reqwest::Client::new();
let endpoint = String::from("api/v2/song/metadata/queue");
let api_url = format!("{}/{}", base_url, endpoint);
client.get(api_url).query(&[("song_queue_id", song_queue_id)]).send().await
client
.get(api_url)
.query(&[("song_queue_id", song_queue_id)])
.send()
.await
}
pub mod response {