The Movie Database 支持

Hello, I have a question.

Does 'timezone' parameter in /api/3/tv/airing_today/ actually works? When I try to use, for example, timezone=Europe/Warsaw it doesn't seem to change anything while I should probably be getting different results. For instance, series which have their premiere in the evening on 25.01.2015 UTC -05:00. In Europe/Warsaw timezone (UTC +02:00) its actually past midnight next day (26.01.2015) so its not really "Today" for Europe/Warsaw

EDIT Also, I have noticed that total_results usually gives bad number on page 1

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

Jump to last post

Hey drab,

We don't have airing times on TMDb, only original air dates. When using the timezones in conjunction with the /tv/aiing_today method, you are able to offset the "midnight" that we're using as the offset to get "today" relevant to which timezone you're requesting for that particular day.

A simple example of this would be right now, it's 6:49 in Calgary (where I'm from) on January 25th. If I query the /tv/airing_today method with the America/Edmonton timezone, I get todays shows:

https://api.themoviedb.org/3/tv/airing_today?api_key=###&timezone=America/Edmonton
{
  "page": 1,
  "results": [
    {
      "backdrop_path": "/uh83Slq60qRSyxKFLR2ZAfUdal7.jpg",
      "id": 1431,
      "original_name": "CSI: Crime Scene Investigation",
      "first_air_date": "2000-10-06",
      "origin_country": [
        "US"
      ],
      "poster_path": "/iUlElECnCViMIV8GnJwIM4A6Fss.jpg",
      "popularity": 24.0886201096114,
      "name": "CSI: Crime Scene Investigation",
      "vote_average": 7.2,
      "vote_count": 17
    },
    {
      "backdrop_path": "/rWO6w0um7SRpvD3QqjLCYxciTDD.jpg",
      "id": 61729,
      "original_name": "Sons of Liberty",
      "first_air_date": "2015-01-25",
      "origin_country": [
        "US"
      ],
      "poster_path": "/y20LiRaCYA2s0hYGafO9K7pC5iI.jpg",
      "popularity": 18.0857943493775,
      "name": "Sons of Liberty",
      "vote_average": 0.0,
      "vote_count": 0
    },
    {
      "backdrop_path": "/gtpPVyRl7TqrfDOa6ACXPc307l.jpg",
      "id": 456,
      "original_name": "The Simpsons",
      "first_air_date": "1989-12-17",
      "origin_country": [
        "US"
      ],
      "poster_path": "/bQKcJ2zfCURXoUAFwjC6kp2fYhR.jpg",
      "popularity": 15.0843239031441,
      "name": "The Simpsons",
      "vote_average": 8.7,
      "vote_count": 60
    },
    ...
  ],
  "total_pages": 3,
  "total_results": 52
}

Where if I query Sydney, Australia where it is 12:50 AM (January 26) I get the following results:

https://api.themoviedb.org/3/tv/airing_today?api_key=###&timezone=Australia/Sydney
{
  "page": 1,
  "results": [
    {
      "backdrop_path": "/rWO6w0um7SRpvD3QqjLCYxciTDD.jpg",
      "id": 61729,
      "original_name": "Sons of Liberty",
      "first_air_date": "2015-01-25",
      "origin_country": [
        "US"
      ],
      "poster_path": "/y20LiRaCYA2s0hYGafO9K7pC5iI.jpg",
      "popularity": 18.0857943493775,
      "name": "Sons of Liberty",
      "vote_average": 0.0,
      "vote_count": 0
    },
    {
      "backdrop_path": "/h3yNfk4t6WVd54birDgCAQfcLtX.jpg",
      "id": 60708,
      "original_name": "Gotham",
      "first_air_date": "2014-09-22",
      "origin_country": [
        "US"
      ],
      "poster_path": "/z2iR0vmuoEU5eL2ONwygDuzzlOy.jpg",
      "popularity": 10.176838601808,
      "name": "Gotham",
      "vote_average": 9.0,
      "vote_count": 19
    },
    {
      "backdrop_path": "/quT8NuFgngkBCQ45laUo71kfiCC.jpg",
      "id": 61920,
      "original_name": "Catastrophe",
      "first_air_date": "2015-01-19",
      "origin_country": [
        "GB"
      ],
      "poster_path": null,
      "popularity": 4.8958275,
      "name": "Catastrophe",
      "vote_average": 0.0,
      "vote_count": 0
    },
    ...
  ],
  "total_pages": 3,
  "total_results": 42
}

I get the shows that air on the 26th.

Could you elaborate about the total results? Both of my queries I used above look proper to me…

Hi, thanks for reply. You can see it right now when you query https://api.themoviedb.org/3/tv/airing_today?api_key=###. Page 1 shows total_results = 42, but page 2 shows total_results=43. Yesterday the difference was even bigger - page 1 showed like 43 and pages 2 and 3 showed 52.

Cheers

I'm seeing the same total_results on each page but I think I know what could be happening. It's a cache thing, since different pages can get cached at different times. Unlike most of our featured list pages, since /tv/airing_today is much more granular and matters down to the minute, the caching for these pages should be removed. I've created a new ticket for this here and will look at it.

Thanks.

I understand how 'timezone' parameters work but I think there is still something wrong with "Europe/Warsaw" timezone (maybe with others as well). Its 00:10 here in Warsaw and request gives me "old" (28.01) results while Europe/Berlin, for instance, is correct (29.01 premieres). Both Berlin and Warsaw are the same +1 timezone though.

Cheers

I believe it's the cache. Ticket 446 will need to be resolved, and then I believe this will work.

Oh, okay. I thought #446 is only for total_results values etc.

Hi, I see that ticked #446 has been resolved but there is still something weird going on with timezones.

Right now both in Melbourne and Sydney it is 02:00, Sunday. I try to query /airing_today for both of those timezones and I am getting different results - Melbourne is fine and Sydney is not (still gives results from Saturday)

Hi drab,

While the ticket is complete, I haven't pushed it to production yet. I have a few more tickets to wrap up and I'll be doing a deploy next week sometime.

I see. Thanks for reply and your work Travis.

Hi drab,

This was just pushed out. You'll see there's now only a 5 minute cache on the /airing_today method now. So while it is still possible you could see a cached response from before "midnight", it will clear out very quickly and return the expected results.

P.S. there could still be a potential issue when dealing with daylight savings. I'm honestly not clear on how I handle that at the moment.

Cheers.

It seems to be working as intended! I'm not sure about daylight saving, guess we will find out when it happens.

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

全站通用

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

在媒体页面

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

在电视季页面

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

在电视集页面

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

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

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

在讨论页面

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

设置

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

登录

还不是会员?

注册加入社区