From 50afccf19332029fa41bfb3e2f58a4ed86ae855b Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 21 Nov 2026 22:37:01 +0800 Subject: [PATCH] fix(media): use ISO-639-1 base codes in TMDB image language fallback & refresh architecture baseline --- app/modules/themoviedb/tmdbapi.py | 5 ++--- docs/architecture-overview.md | 2 +- tests/fixtures/architecture/dependency-baseline.json | 7 +++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/modules/themoviedb/tmdbapi.py b/app/modules/themoviedb/tmdbapi.py index d61cf87ba..6a2153f4a 100644 --- a/app/modules/themoviedb/tmdbapi.py +++ b/app/modules/themoviedb/tmdbapi.py @@ -1411,7 +1411,7 @@ class TmdbApi: @staticmethod def _build_include_image_language(original_language: Optional[str] = None) -> str: """ - 构造图片接口语言回退列表,优先当前语言及其基础语言码,避免当前语言没有图片时返回空列表。 + 构造 TMDB 图片接口 ISO-639-1 语言回退列表,优先当前语言,避免当前语言没有图片时返回空列表。 """ from app.runtime.localization import LocaleHelper @@ -1423,9 +1423,8 @@ class TmdbApi: text = str(raw_locale or "").strip() if not text: continue - candidates.append(text) base = text.split("-")[0].split("_")[0].strip().lower() - if base and base != text.lower(): + if base: candidates.append(base) candidates.extend(["en", None, original_language]) diff --git a/docs/architecture-overview.md b/docs/architecture-overview.md index 1eb7a642b..b4e783ef6 100644 --- a/docs/architecture-overview.md +++ b/docs/architecture-overview.md @@ -851,7 +851,7 @@ flowchart LR | 指标 | 当前值 | |---|---:| | Python 模块 | 1190 | -| 内部导入边 | 10,436 | +| 内部导入边 | 10,439 | | 非平凡 SCC | 1(29 个模块的 TMDB vendor 精确 containment) | | Application / Chain 具体 Adapter 直连 | 0 / 0 | | Direct egress | 52(精确 policy 准入,Application / Chain 均为 0;本知识 Adapter 仍复用宿主 HTTP 层) | diff --git a/tests/fixtures/architecture/dependency-baseline.json b/tests/fixtures/architecture/dependency-baseline.json index ab80f8afa..d6de3dea2 100644 --- a/tests/fixtures/architecture/dependency-baseline.json +++ b/tests/fixtures/architecture/dependency-baseline.json @@ -977,8 +977,8 @@ "runtime_only": true } }, - "edge_count": 10436, - "edge_sha256": "3e3475aea3339aa6161d6a47463f55b78928a77525c5531cb213ce48e4b1c7ec", + "edge_count": 10439, + "edge_sha256": "fb6a89a847896d271ec9aeef7cc19391950e76d9635320ae2e5fe20bb9da05c4", "edges": [ "app -> app.foundation", "app -> app.foundation.environment", @@ -7825,6 +7825,7 @@ "app.modules.fanart -> app.modules", "app.modules.fanart -> app.runtime", "app.modules.fanart -> app.runtime.cache", + "app.modules.fanart -> app.runtime.localization", "app.modules.fanart -> app.runtime.log", "app.modules.fanart -> app.runtime.settings", "app.modules.fanart -> app.runtime.tasks", @@ -8993,6 +8994,7 @@ "app.modules.themoviedb -> app.modules.themoviedb.tmdbv3api", "app.modules.themoviedb -> app.modules.themoviedb.tmdbv3api.exceptions", "app.modules.themoviedb -> app.runtime", + "app.modules.themoviedb -> app.runtime.localization", "app.modules.themoviedb -> app.runtime.log", "app.modules.themoviedb -> app.runtime.settings", "app.modules.themoviedb -> app.schemas", @@ -9046,6 +9048,7 @@ "app.modules.themoviedb.tmdbapi -> app.modules.themoviedb.tmdbv3api", "app.modules.themoviedb.tmdbapi -> app.modules.themoviedb.tmdbv3api.exceptions", "app.modules.themoviedb.tmdbapi -> app.runtime", + "app.modules.themoviedb.tmdbapi -> app.runtime.localization", "app.modules.themoviedb.tmdbapi -> app.runtime.log", "app.modules.themoviedb.tmdbapi -> app.runtime.settings", "app.modules.themoviedb.tmdbapi -> app.schemas",