The Movie Database Support Forum

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 Antworten (Seite 1 von 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.

Es fehlt ein Film oder eine Serie? Logge dich ein zum Ergänzen.

Allgemein

s Fokus auf Suchfeld
p Profil öffnen
esc Fenster schließen
? Tastenkürzel anzeigen

Videos

b Zurück
e Bearbeiten

Staffeln

Nächste Staffel
Vorherige Staffel

Episoden

Nächste Episode
Vorherige Episode

Bilder

a Poster oder Hintergrundbild hinzufügen

Editieren

t Sprachauswahl öffnen
ctrl+ s Speichern

Diskussionen

n Neue Diskussion erstellen
w Beobachten an / aus
p Diskussion öffentlich / privat
c Diskussion öffnen / schließen
a Diskussionsverlauf anzeigen
r Auf Diskussion antworten
l Letzte Antwort anzeigen
ctrl+ enter Senden
Nächste Seite
Vorherige Seite

Einstellungen

Diesen Eintrag bewerten oder zu einer Liste hinzufügen?

Anmelden