This is yet another client for TMDB, but it supports async functions.
cargo add tmdb-api
use tmdb_api::tvshow::search::TVShowSearch;
use tmdb_api::prelude::Command;
use tmdb_api::client::Client;
use tmdb_api::client::reqwest::ReqwestExecutor;
#[tokio::main]
async fn main() {
let secret = std::env::var("TMDB_TOKEN_V3").unwrap();
let client = Client::<ReqwestExecutor>::new(secret);
let cmd = TVShowSearch::new("simpsons".into());
let result = cmd.execute(&client).await.unwrap();
let item = result.results.first().unwrap();
println!("TVShow found: {}", item.inner.name);
}
cargo test
If you want to run some integration tests, just export a TMDB_TOKEN_V3
environment variable and run
cargo test --features integration