radiobrowser-lib-rust/src/bin/test.rs

24 lines
728 B
Rust
Raw Normal View History

2022-04-21 18:56:01 +00:00
use futures::join;
2022-04-20 19:51:14 +00:00
use radiobrowser_lib_rust::RadioBrowserAPI;
2022-04-21 18:56:01 +00:00
use radiobrowser_lib_rust::StationOrder;
2022-04-18 23:55:26 +00:00
use std::error::Error;
#[async_std::main]
async fn main() -> Result<(), Box<dyn Error>> {
2022-04-20 19:51:14 +00:00
let mut api = RadioBrowserAPI::new().await?;
2022-04-21 18:56:01 +00:00
let countries = api.get_countries().filter("a").send();
let stations = api
.search()
.name("jazz")
.reverse(true)
.order(StationOrder::Clickcount)
.send();
let config = api.get_server_config();
let (stations, config, countries) = join!(stations, config, countries);
println!("Config: {:#?}", config?);
println!("Countries found: {}", countries?.len());
println!("Stations found: {}", stations?.len());
2022-04-18 23:55:26 +00:00
Ok(())
}