fix(tmdb): 特别季 Season 00 的年份改用 TMDB 实际首播年
- 取消早期「Season 00 年份强制等于 Season 01」的规则,一律以 TMDB 各季 air_date 为准(如《我的三体》特别篇 2019 / 第一季 2014) - 已按新规则刷新缓存中 31 个含特别季的剧集,其中 13 个的 00 年份发生变化 (老友记 1994→2001、爱情公寓 2009→2015、花儿与少年 2014→2022 等)
This commit is contained in:
@@ -139,7 +139,8 @@ def _year_of(payload: dict) -> int | None:
|
|||||||
def season_years_from(payload: dict) -> dict[str, str]:
|
def season_years_from(payload: dict) -> dict[str, str]:
|
||||||
"""从 /tv/{id} 的 seasons 数组生成 {"01": "2023"}。
|
"""从 /tv/{id} 的 seasons 数组生成 {"01": "2023"}。
|
||||||
|
|
||||||
特别季 Season 00 的 air_date 通常散落各年,统一取 Season 01 的年份。
|
一律以 TMDB 各季的 air_date 为准,特别季 Season 00 也不例外
|
||||||
|
(例如《我的三体》特别篇 2019,第一季 2014)。
|
||||||
"""
|
"""
|
||||||
out: dict[str, str] = {}
|
out: dict[str, str] = {}
|
||||||
for season in payload.get("seasons") or []:
|
for season in payload.get("seasons") or []:
|
||||||
@@ -150,8 +151,6 @@ def season_years_from(payload: dict) -> dict[str, str]:
|
|||||||
air = (season.get("air_date") or "").strip()
|
air = (season.get("air_date") or "").strip()
|
||||||
if len(air) >= 4 and air[:4].isdigit():
|
if len(air) >= 4 and air[:4].isdigit():
|
||||||
out[num] = air[:4]
|
out[num] = air[:4]
|
||||||
if "00" in out and "01" in out:
|
|
||||||
out["00"] = out["01"]
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user