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

I am writing an application in Perl to display movies released in the last week. I have the code working, but it's slow. I call the API with discover/movie to get all the newly released movies, and then call the API with movie/{id}/releases for each of the movies so I can extract only movies with US releases. This code takes about 10 seconds. Then I call the API with movie/{id} to get basic information about each of the movies. This portion takes about 13 seconds. So, to get a complete list of US-released movies for one week takes about 23 seconds (depending on how many movies were released that week). This is obviously slow. If I want to use the API for this purpose, is it expected that I write code to download the entire database, update the data periodically, and access the data locally?

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

Jump to last post

Hi celiao,

A few things.

Use ?append_to_response so you only have to make the movie call with releases once. That's half as many calls as you're currently making.

Depending on the way the interface works, most people don't go and query every page of the discover results. Most UI's might only show 10 items at a time, so you can only grab the first page and as the user scrolls be loading more pages behind the scene. This way you're only grabbing 20 items at a time. For examples of this depending what platform you're on, there's a number of apps you can see who have implemented something like that on our apps page.

We let you do approximately 3 requests per second so you can do multiple requests at a time if you spun up concurrent requests.

Depends what you're trying to build. Lots of apps just query our DB directly while others are doing a lot more custom things that require their own DB.

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

Global

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

در صفحات مدیا

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

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

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

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

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

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

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

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

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

در صفحات بحث

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

تنظیمات

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

ورود