The Movie Database 支持

Hi,

I noticed an issue with the Multi search endpoint: https://api.themoviedb.org/3/search/multi

It has a poster_path in the response object, but it's always null. When checking the Person search, the image can be found under profile_path instead of poster_path.

I was wondering if the backend can fix that by redirecting the Person profile_path as a poster_path in the Multi endpoint.

Thank you.

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

Jump to last post

Hi @gustavopeq, no, we cannot make a change like this.

Every media object returned across all of the many different endpoints are the same. Whether it's search, lists, popular, or trending, everything is consistent per media type.

You'll have to check which media type it is you're dealing with and template out accordingly. Note the media_type field that is returned so you can make that decision.

Cheers.

Understood... So when using this Multi endpoint, if I need to display the Person's profile picture, it's expected that I do an extra API call by the Person ID, to be able to get the profile_path right? Thanks @travisbell

@gustavopeq said:

...it's expected that I do an extra API call by the Person ID, to be able to get the profile_path right?

No. The profile_path field is returned as part of the object. Here's the response for a search of "Brad Pitt", notice the first response has a profile_path field

Request

curl -v "http://api.themoviedb.org/3/search/multi?api_key=###&query=brad+pitt"

*   Trying [2600:9000:201e:2800:c:174a:c400:93a1]:80...
* Connected to api.themoviedb.org (2600:9000:201e:2800:c:174a:c400:93a1) port 80
> GET /3/search/multi?api_key=###&query=brad+pitt HTTP/1.1
> Host: api.themoviedb.org
> User-Agent: curl/8.4.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json;charset=utf-8
< Content-Length: 4176
< Connection: keep-alive
< Date: Fri, 26 Jan 2024 23:03:22 GMT
< Server: openresty
< Cache-Control: public, max-age=12698
< x-memc: HIT
< x-memc-key: ed0cade417eee6ebbd8a04b6e5505653
< x-memc-age: 12612
< x-memc-expires: 12698
< ETag: W/"b14717f2ce17309a1a72b5526a9fbf3c"
< Vary: Accept-Encoding
< X-Cache: Miss from cloudfront
< Via: 1.1 de2ed3c94563fee614f35f9bc3f52d1c.cloudfront.net (CloudFront)
< X-Amz-Cf-Pop: IAD89-C3
< Alt-Svc: h3=":443"; ma=86400
< X-Amz-Cf-Id: KNctMrkrIMapvE0OtNp_M1YSWWEuP5e5vosws98YZvFFs5ITg8OqDQ==
< Vary: Origin
<
* Connection #0 to host api.themoviedb.org left intact

Response

{
    "page": 1,
    "results": [
        {
            "adult": false,
            "id": 287,
            "name": "Brad Pitt",
            "original_name": "Brad Pitt",
            "media_type": "person",
            "popularity": 42.404,
            "gender": 2,
            "known_for_department": "Acting",
            "profile_path": "/cckcYc2v0yh1tc9QjRelptcOBko.jpg",
            "known_for": [
                ...
            ]
        },
        {
            "adult": false,
            "backdrop_path": "/gt07Tw1IMbHbYpkJTCtqCEj0J8W.jpg",
            "id": 1033548,
            "title": "Brad Pitt: More Than a Pretty Face",
            "original_language": "fr",
            "original_title": "Brad Pitt, la revanche d'un blond",
            "overview": "Brad Pitt is a singular actor in Hollywood's glamorous world, breaking through his \"playboy image\" and embodying American cinema's renewal. At the beginning there was a humble Midwestern aware of being a smokescreen for the illusions of his time, who has managed to keep control of his image to better serve the most talented directors of our time. To name but a few: David Fincher, Quentin Tarantino, the Coen brothers, Terrence Malick, James Gray and soon Damien Chazelle. This documentary dives into the brain of a complex, brilliant and endearing personality, far from the cliché of a world-famous movie icon to discover the hidden side of the most handsome man in the world.",
            "poster_path": "/lVpi5vYqpEcHn74YqWQhihKz0yk.jpg",
            "media_type": "movie",
            "genre_ids": [
                99,
                10770
            ],
            "popularity": 4.496,
            "release_date": "2022-10-09",
            "video": false,
            "vote_average": 7.2,
            "vote_count": 10
        },
        {
            "adult": false,
            "backdrop_path": null,
            "id": 923893,
            "title": "Brad Pitt & Jennifer Aniston: Hollywood's Couple of the Year",
            "original_language": "en",
            "original_title": "Brad Pitt & Jennifer Aniston: Hollywood's Couple of the Year",
            "overview": "This documentary explores the sequence of events that led A-listers Brad Pitt and Jennifer Aniston to one another, and recounts their relationship in the international spotlight.",
            "poster_path": null,
            "media_type": "movie",
            "genre_ids": [],
            "popularity": 0.621,
            "release_date": "2000-01-01",
            "video": false,
            "vote_average": 6,
            "vote_count": 1
        }
    ],
    "total_pages": 1,
    "total_results": 3
}

Ohhh, so it does comes with the profile_path when the media_type is "person" I was using "Response 200 body" in https://developer.themoviedb.org/reference/search-multi , and it doesn't list the profile_path there, so I thought it didn't exist at all. That makes more sense... Thanks a lot @travisbell

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

全站通用

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

在媒体页面

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

在电视季页面

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

在电视集页面

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

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

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

在讨论页面

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

设置

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

登录

还不是会员?

注册加入社区