tmdb - find.go
1 package tmdb
2
3 import (
4 "net/url"
5 )
6
7 // FindResults contains the results from the Find call
8 type FindResults struct {
9 MovieResults []MovieResult `json:"movie_results"`
10 PersonResults []PeopleResult `json:"person_results"`
11 TVResults []TVResult `json:"tv_result"`
12 }
13
14 // Find searches the database for movies, people, or TV shows that reference the given external ID
15 func (t *TMDB) Find(id, source string, params ...option) (*FindResults, error) {
16 f := new(FindResults)
17 if err := t.get(f, "/3/find/"+id, url.Values{"external_source": []string{source}}, params...); err != nil {
18 return nil, err
19 }
20 return f, nil
21 }