cavestri / themoviedb-javascript-library

A Javascript library to interact with themoviedb.org Rest API.
http://askfranco.com
MIT License
330 stars 108 forks source link

No Function for Multi Search #38

Closed afzaalb closed 6 years ago

afzaalb commented 6 years ago

The actual tmdb-api has multi search feature, but i was unable to find this in your wrapper. I'm forced to do three request with search for Tv,movies and people. It'd be better if you can either suggest a way to do it, or add the multiSearch function. https://developers.themoviedb.org/3/search/multi-search

cavestri commented 6 years ago

Hi, it's in:

theMovieDb.search.getMulti

Greetings!

afzaalb commented 6 years ago

theMovieDb.search.getMulti( { query: queryString.target.value }, this.successCB, this.errorCB ); I have actually tried this and it doesn't work ! I'm using it in a react application and i get this error. Error: Uncaught TypeError: _themoviedbJavascriptLibrary2.default.search.getMulti is not a function

cavestri commented 6 years ago

Hi afzaalopera, i don't know which version of the library are you using but with the last one it works, e.g.:

search.getMulti({query: "brad pit"}, successCallback, errorCallback)

Result:

{ "page": 1, "total_results": 1, "total_pages": 1, "results": [{ "popularity": 12.964198, "media_type": "person", "id": 287, "profile_path": "\/kU3B75TyRiCgE270EyZnHjfivoq.jpg", "name": "Brad Pitt", "known_for": [{ "vote_average": 8.3, "vote_count": 12319, "id": 550, "video": false, "media_type": "movie", "title": "Fight Club", "popularity": 30.141538, "poster_path": "\/adw6Lq9FiC9zjYEpOqfq03ituwp.jpg", "original_language": "en", "original_title": "Fight Club", "genre_ids": [18], "backdrop_path": "\/mMZRKb3NVo5ZeSPEIaNW9buLWQ0.jpg", "adult": false, "overview": "A ticking-time-bomb insomniac and a slippery soap salesman channel primal male aggression into a shocking new form of therapy. Their concept catches on, with underground \"fight clubs\" forming in every town, until an eccentric gets in the way and ignites an out-of-control spiral toward oblivion.", "release_date": "1999-10-15" }, { "vote_average": 8, "vote_count": 8592, "id": 16869, "video": false, "media_type": "movie", "title": "Inglourious Basterds", "popularity": 23.274524, "poster_path": "\/6zYuTKyvcwmtNvXXvJZNT0IgBL0.jpg", "original_language": "en", "original_title": "Inglourious Basterds", "genre_ids": [18, 28, 53, 10752], "backdrop_path": "\/bk0GylJLneaSbpQZXpgTwleYigq.jpg", "adult": false, "overview": "In Nazi-occupied France during World War II, a group of Jewish-American soldiers known as \"The Basterds\" are chosen specifically to spread fear throughout the Third Reich by scalping and brutally killing Nazis. The Basterds, lead by Lt. Aldo Raine soon cross paths with a French-Jewish teenage girl who runs a movie theater in Paris which is targeted by the soldiers.", "release_date": "2009-08-18" }, { "vote_average": 8.2, "vote_count": 7664, "id": 807, "video": false, "media_type": "movie", "title": "Se7en", "popularity": 36.633202, "poster_path": "\/zgB9CCTDlXRv50Z70ZI4elJtNEk.jpg", "original_language": "en", "original_title": "Se7en", "genre_ids": [80, 9648, 53], "backdrop_path": "\/A0WKbRIojF9DUWG4XLCmg5JK6I5.jpg", "adult": false, "overview": "Two homicide detectives are on a desperate hunt for a serial killer whose crimes are based on the \"seven deadly sins\" in this dark and haunting film that takes viewers from the tortured remains of one victim to the next. The seasoned Det. Sommerset researches each sin in an effort to get inside the killer's mind, while his novice partner, Mills, scoffs at his efforts to unravel the case.", "release_date": "1995-09-22" }], "adult": false }] }

Greetings!

afzaalb commented 6 years ago

Thank you ! It works. my versions was 1.0