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

url 'https://api.themoviedb.org/3/discover/movie?include_adult=false&include_video=false&language=en-US&page=1&sort_by=popularity.desc'

This plain call to discover works - it sorts the returned movies by their popularity, but when I add a keyword (christmas, for instance), it returns movies that have the indicated keyword in it, but they aren't sorted.

url 'https://api.themoviedb.org/3/discover/movie?include_adult=false&include_video=false&language=en-US&page=1&sort_by=popularity.desc&with_keywords=207317'
 {
  "page": 1,
  "results": [
    {
      "adult": false,
      "backdrop_path": "/zb55epJxheUmtd1jz2jihAaVtUF.jpg",
      "genre_ids": [
        14,
        10751,
        35
      ],
      "id": 1001884,
      "original_language": "en",
      "original_title": "Dashing Through the Snow",
      "overview": "Eddie Garrick is a good-hearted man who has lost his belief in the wonder of Christmas. While spending time with his nine-year-old daughter Charlotte on Christmas Eve, he befriends a mysterious man in a red suit named Nick.",
      "popularity": 234.038,
      "poster_path": "/AnfXxsoLBS6JDpu65vHsEvEcWSA.jpg",
      "release_date": "2023-11-17",
      "title": "Dashing Through the Snow",
      "video": false,
      "vote_average": 7.9,
      "vote_count": 20
    },
    {
      "adult": false,
      "backdrop_path": "/hziiv14OpD73u9gAak4XDDfBKa2.jpg",
      "genre_ids": [
        12,
        14
      ],
      "id": 671,
      "original_language": "en",
      "original_title": "Harry Potter and the Philosopher's Stone",
      "overview": "Harry Potter has lived under the stairs at his aunt and uncle's house his whole life. But on his 11th birthday, he learns he's a powerful wizard—with a place waiting for him at the Hogwarts School of Witchcraft and Wizardry. As he learns to harness his newfound powers with the help of the school's kindly headmaster, Harry uncovers the truth about his parents' deaths—and about the villain who's to blame.",
      "popularity": 166.136,
      "poster_path": "/wuMc08IPKEatf9rnMNXvIDxqP4W.jpg",
      "release_date": "2001-11-16",
      "title": "Harry Potter and the Philosopher's Stone",
      "video": false,
      "vote_average": 7.9,
      "vote_count": 25625
    },
    {
      "adult": false,
      "backdrop_path": "/q36IxmZJd0LeZXziLxFRpF3P6nI.jpg",
      "genre_ids": [
        35
      ],
      "id": 987490,
      "original_language": "en",
      "original_title": "Best. Christmas. Ever!",
      "overview": "When a twist of fate lands Charlotte and her family at her old college friend’s Jackie’s house only days before Christmas, she seizes the opportunity to prove her old friend's life isn’t as wonderful as it seems from her holiday newsletter.",
      "popularity": 181.008,
      "poster_path": "/yNPgjXeeb7vdNI7AQB5SWkkk6si.jpg",
      "release_date": "2023-11-16",
      "title": "Best. Christmas. Ever!",
      "video": false,
      "vote_average": 5.6,
      "vote_count": 52
    }

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

Jump to last post

Hi @atarihomestar,

You likely made a request during one of our daily re-indexes. I'm seeing them being returned in order now.

pry(main)> uri = Addressable::URI.parse("https://api.themoviedb.org/3/discover/movie?api_key=###&include_adult=false&include_video=false&language=en-US&page=1&sort_by=popularity.desc&with_keywords=207317")
pry(main)> parsed_response = JSON.parse(Net::HTTP.get(uri))
pry(main)> parsed_response["results"].map { |item| item["popularity"] }
  => [234.038, 212.188, 181.008, 166.136, 151.936, 148.551, 147.953, 143.056, 134.676, 128.413, 124.034, 114.867, 114.857, 112.483, 111.837, 111.71, 104.058, 91.635, 90.019, 85.127]

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

Global

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

در صفحات مدیا

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

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

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

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

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

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

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

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

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

در صفحات بحث

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

تنظیمات

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

ورود