پشتیبانی پایگاه داده‌ فیلم

I am trying to create a film search portal through the API. The issue I am having is I am receiving results that include collections even though I am using the movies search endpoint. Any easy way to exclude collections?

4 پاسخ (در صفحه 1 از 1)

Jump to last post

@nmotamedi said:
Search movies and block collections
I am trying to create a film search portal through the API.
The issue I am having is I am receiving results that include collections even though I am using the movies search endpoint.
Any easy way to exclude collections?

Problems with API Request

In order for someone to help you with API Request questions,
it is critical that you post here the API Request you are sending to the TMDb server.
Remember to replace your Key with MY_KEY , YOUR_KEY , THE_KEY , or something like that.

Not the programming code/script you used to build the API Request.
But the API Request that is sent to the TMDb server.
Or the API Request you would like to send.

await fetch( https://api.themoviedb.org/3/search/movie?query=polar%20express&include_adult=false&language=en-US&page=1, {headers: { Authorization: Bearer <TMDB_TOKEN>, }}, );

When I make this request, I receive the Polar Express Collection as a result as well, which it causing some issues when displaying those details since the TMDbID for the collection won't work when populating detail results.

@nmotamedi said:

await fetch(
https://api.themoviedb.org/3/search/movie?query=polar%20express&include_adult=false&language=en-US&page=1,
{headers: {
Authorization: Bearer <TMDB_TOKEN>,
}},
);

When I make this request, I receive the Polar Express Collection as a result as well, which it causing some issues when displaying those details since the TMDbID for the collection won't work when populating detail results.

Hummm
I believe it is not possible to filter/eliminate the collection in the response.
Movies and collections are in the same DB.
Maybe Travis Bell, the admin, has a solution for this.
Let's wait for him to come by.

Just to resurrect this, I'm seeing this same issue for How to Train Your Dragon when searching for "How To Train your Dragon Live Action" (a title used by some cinemas)

Request:

curl --request GET \
     --url 'https://api.themoviedb.org/3/search/movie?query=How%20To%20Train%20your%20Dragon%20Live%20Action&include_adult=false&language=en-US&page=1' \
     --header 'Authorization: Bearer <token>' \
     --header 'accept: application/json'

Response:

{
  "page": 1,
  "results": [
    {
      "adult": false,
      "backdrop_path": "/eKpWn8DwS6xpAKs4eLb4PmrXnhk.jpg",
      "id": 1458864,
      "original_language": "en",
      "original_title": "How to Train Your Dragon (Live-Action) Collection",
      "overview": "A live-action remake franchise based on the DreamWorks Animation's \"How to Train Your Dragon\" films.",
      "poster_path": null,
      "title": "How to Train Your Dragon (Live-Action) Collection"
    }
  ],
  "total_pages": 1,
  "total_results": 1
}

This response contains a collection (it's fine that it didn't return the the movie 1087192 given the addition of the unnecessary "Live Action" bit in the query that's not in the actual title of the movie) -- but there's nothing indicating that this result is a collection and not a movie (other than checking the title text, which isn't a clear indicator). Using the ID from this result (1458864) to look up the movie will fail with a 404. Ideally this search should return no results, as no movies were matched (and to get collections, we can use the collections search endpoint).

فیلم و نمایش تلویزیونی را نمی‌توانید پیدا کنید؟ به سیستم وارد شوید تا آن را ایجاد کنید.

Global

s تمرکز بر منوی جستجو
p منوی پروفایل باز شود
esc بستن پنجره باز
? پنجره میانبرهای صفحه‌کلید باز شود

در صفحات مدیا

b بازگشت به عقب (یا در صورت لزوم به منشا)
e برو به صفحه ویرایش

در صفحات فصل تلویزیونی

(فلش سمت راست) برو به فصل بعد
(پیکان سمت چپ) برو به نشست قبلی

در صفحات قسمت تلویزیونی

(فلش سمت راست) برو به قسمت بعد
(پیکان سمت چپ) برو به قسمت قبلی

در تمام صفحات تصویر

a پنجره افزودن تصویر باز شود

در تمام صفحات ویرایش

t انتخابگر ترجمه باز شود
ctrl+ s ثبت از

در صفحات بحث

n ایجاد بحث جدید
w تغییر وضعیت وضعیت تماشا
p تغییر وضعیت عمومی/خصوصی
c تغییر وضعیت بسته/باز
a گشایش صفحه فعالیت
r پاسخ به بحث
l برو به آخرین پاسخ
ctrl+ enter پیام خود را ثبت کنید
(فلش سمت راست) صفحه بعد
(پیکان سمت چپ) صفحه قبلی

تنظیمات

آیا می‌خواهید به این مورد امتیاز دهید یا به فهرست اضافه کنید؟

ورود