fetch song queue data #21
@@ -1,5 +1,6 @@
|
|||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
|
pub const SECONDS_TO_SLEEP: u64 = 5;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
@@ -18,6 +19,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
if !song_queue_item.data.is_empty() {
|
if !song_queue_item.data.is_empty() {
|
||||||
println!("Song queue item: {:?}", song_queue_item);
|
println!("Song queue item: {:?}", song_queue_item);
|
||||||
|
|
||||||
|
println!("Fetching song queue data");
|
||||||
match api::fetch_song_queue_data::get_data(
|
match api::fetch_song_queue_data::get_data(
|
||||||
&app_base_url,
|
&app_base_url,
|
||||||
&song_queue_item.data[0].id,
|
&song_queue_item.data[0].id,
|
||||||
@@ -33,7 +35,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
println!("Saved at: {:?}", save_path);
|
println!("Saved at: {:?}", save_path);
|
||||||
|
|
||||||
|
|
||||||
// TODO: Get queued song's metadata
|
// TODO: Get queued song's metadata
|
||||||
// TODO: Get queued coverart
|
// TODO: Get queued coverart
|
||||||
// TODO: Get queued coverart's data
|
// TODO: Get queued coverart's data
|
||||||
@@ -61,7 +62,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
println!("Sleeping");
|
println!("Sleeping");
|
||||||
tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
|
tokio::time::sleep(tokio::time::Duration::from_secs(SECONDS_TO_SLEEP)).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user