Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include themoviedb ids and cast / credits? #120

Open
jakewaterman51 opened this issue May 14, 2018 · 0 comments
Open

Include themoviedb ids and cast / credits? #120

jakewaterman51 opened this issue May 14, 2018 · 0 comments

Comments

@jakewaterman51
Copy link

I'm currently manually using "themoviedb" to make 2 request:

  1. Convert the IMDB ID to a TMDB ID.
  2. Use the TMDB ID to get the directors, writers, creators & cast etc...

Each request takes over a second so it really adds up.

There's no way around that first request but the second one I can do in parallel with the popcorn api request so it's not really a problem.

Alternatively also adding the credits from themoviedb to popcorn api.

A basic PHP example for getting a TMDB ID using an IMDB ID:

$response = file_get_contents("https://api.themoviedb.org/3/find/".$imdb_id."?".http_build_query(array(
	"api_key" => $access_key,
	"language" => "en-US",
	"external_source" => "imdb_id"
)));

if ($section == "movies" && !empty($response->movie_results)) {
	return $response->movie_results[0]->id;
} else if ($section == "shows" && !empty($response->tv_results)) {
	return $response->tv_results[0]->id;
} else {
	return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant