The Movie Database
This is a wrapper around the TMDb API.
Usage
extern crate tmdb;
use *;
use *;
Actions
Currently there are 3 actions available:
- Searching
- Fetching
- Finding
Searching
You can search for movies by title
and year
.
let page = tmdb.search
.title
.year
.execute
.unwrap;
let movies = page.results;
Fetching
You can fetch a movie, when you know its ID. Then you get all the movie details.
let movie = tmdb.fetch
.id
.execute
.unwrap;
When you don't have any movie ID, you can search for a movie and then easily fetch the full details.
let page = tmdb.search
.title
.year
.execute
.unwrap;
let movies = page.results;
let movie = movies.fetch.unwrap;
Furthermore you can request some more data with the append to response feature.
let movie = tmdb.fetch
.id
.append_videos
.append_credits
.execute
.unwrap;
Finding
Finding a movie with an external ID is currently supported with IMDB IDs.
let find_result = tmdb.find
.imdb_id
.execute
.unwrap;
let movies = find_result.movie_results;
Acknowledgements
- This lib is heavily inspired by omdb-rs