The Movie Database サポート

Hi Travis,

I am working on an application that has an autocomplete function which makes a JSONP request as follows:

http://api.themoviedb.org/3/search/movie?api_key=[API_key_here]&query=[search_term]

where the "search_term" comes from the autocomplete function. I want to be able to display the poster image for each of the search results (to do this, I need: base_url, size and file_path, according to the configuration documentation). However, I notice that the above search only returns the file_path for the poster, and to display the image I still need the "size" Is there any way to do this without making another xhr request? If I try to get the image without the size parameter (http://cf2.imgobject.com/t/p/bgSHbGEA1OM6qDs3Qba4VlSZsNG.jpg) it obviously does not work.

Thanks in advance for the help!

3 replies (on page 1 of 1)

Jump to last post

To add to the above, if I use a generalized url as follows:

http://cf2.imgobject.com/t/p/w500/8uO0gUM8aNqYLs1OsTBQiXu0fEv.jpg

where I specify the size as w500, I see that this works for all the posters. The problem is, since the size of the file is pretty large, the images get added to the search results of the autocomplete function with a significant lag after the results are loaded. To overcome this issue, I think I need to get the smallest file or something like a thumbnail for the image. Is this possible?

However, I notice that the above search only returns the filepath for the poster, and to display the image I still need the "size" Is there any way to do this without making another xhr request?

Just make the request once, and then cache it for repeated use. That data isn't likely to change often, so you could even store it semi-permanently in a cookie if you so desired. The documentation explicitly recommends you store it in some manner. RFC2109 dictates at minimum 4096 bytes be available for use per-cookie, so there would be plenty of storage room on any standards compliant browser.

The problem is, since the size of the file is pretty large

Remember there are multiple sizes you can request. Check out the configuration method for more details.

映画やテレビ番組が見つかりませんか?ログインして作成してください。

全般

s 検索バーに移動する
p プロファイルメニューを開く
esc 開いているウィンドウを閉じる
? キーボードショートカットウィンドウを開く

メディアのページ

b 戻る(または該当する場合は親に)
e 編集ページに行く

テレビ番組のシーズンのページ

(右矢印)次のシーズンに行く
(左矢印)前のシーズンに戻る

テレビ番組のエピソードのページ

(右矢印)次のエピソードに進む
(左矢印)前のエピソードに戻る

全ての画像のページ

a 画像追加ウィンドウを開く

全ての編集ページ

t 翻訳選択を開く
ctrl+ s フォームを送信する

ディスカッションのページ

n 新しいディスカッションを作成する
w 監視ステータスを切り替える
p 公開/非公開を切り替える
c 閉じる/開くを切り替える
a アクティビティを開く
r ディスカッションに返信
l 最後の返事に行く
ctrl+ enter メッセージを送信する
(右矢印)次のページ
(左矢印)前のページ

設定

このアイテムを評価したり、リストに追加したりしたいですか?

ログイン

メンバーではありませんか?

登録してコミュニティに参加