The Movie Database 支持

Hello everyone I have a question regarding some functionality that I want to add to my iOS app. I am mostly a frontend guy and therefore any help would be appreciated.

Right now, I have a textbox where I can enter a name of a movie, or an actor, etc. and it will display a table view list with all the matches.

I am doing that by accessing directly the TMDB API search.

That works fine, however, it takes a few seconds to complete which makes total sense.

I want to be able to have some autocomplete on my text field when I start typing in it. I know that this is not possible since it needs a few seconds each time to get any results. Do you guys know if there is a way of doing that? Can I somehow get ALL the movies from the TMDB database? Is this data going to be TOO much to store it locally?

Thanks

Dimitris

6 回复(第 1 页,共 1 页)

Jump to last post

Hi Dimitris,

Our search methods support autocomplete already, you'll notice if you fire off partial search requests you get matches. In fact, the website search here on TMDb is just making straight API requests.

It should be very performant but you will always have the network latency to worry about depending on where you're located. For me it's pretty fast (I'm in Canada, the API is ran on servers in the U.S.), you can see it in action here. That is literally our autocomplete search here on the website making /search/multi requests.

You'll notice the first request is a little longer (300ms) because it's spending time connecting and doing all the SSL handshake stuff. Since we support keep alive though, every request after that is super fast (~75ms).

So, with regards to speed this will have the most to do with network latency than anything else. Depending on where you're located, if you want to shorten the network latency, you would have to store and cache the data locally on a server closer to you. Caching the data is fine, but yes, that's what you would have to do.

Thank you for quick response.

I am kind of confused about some details. first of all, what do you mean you support autocomplete? do you mean that speedwise you can support it?

Also, I am in the US and I have noticed that it takes around 10 sec to get the movies. I think this is too long and I am pretty sure that it doesnt have to do anything with the app itself.

I am also requesting the images which I guess might take more time. This is the url for search "https://api.themoviedb.org/3/search/movie?api_key=" where i input the query with the name of the movie after the key.

I cant understand what might be taking so long.

Is there any example or something? Sorry for all these questions

Hi,

Travis would you please put some example ? :)

https://api.themoviedb.org/3/search/multi?api_key=####&language=en-US&query=avatar&page=1&include_adult=false

@zabkas said:

https://api.themoviedb.org/3/search/multi?api_key=####&language=en-US&query=avatar&page=1&include_adult=false

Does this method work for auto-suggesting URL when adding it to Vivaldi? I have generated an API key and tried it but that did not work.

My suggest URL was: https://api.themoviedb.org/3/search/multi?api_key={redacted}&language=en-US&query=avatar&page=1&include_adult=false

https://imgur.com/iBlaUgU

@swkazashi@outlook.com Can you create a new thread please? I don't know the answer to your question but this thread has nothing to do with Vivaldi.

Thanks!

找不到电影或节目?登录并创建它吧。

全站通用

s 聚焦到搜索栏
p 打开个人资料菜单
esc 关闭打开的窗口
? 打开键盘快捷键窗口

在媒体页面

b 返回(或返回上级)
e 进入编辑页面

在电视季页面

(右箭头)下一季
(左箭头)前一季

在电视集页面

(右箭头)下一集
(左箭头)上一集

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

t 打开翻译选择器
ctrl+ s 提交

在讨论页面

n 创建新讨论
w 切换关注状态
p 设为公开 / 私密讨论
c 关闭 / 开放讨论
a 打开活动页
r 回复讨论
l 跳转至最新回复
ctrl+ enter 发送信息
(右箭头)下一页
(左箭头)前一页

设置

想给这个条目评分或将其添加到片单中?

登录

还不是会员?

注册加入社区