fix(media): use ISO-639-1 base codes in TMDB image language fallback & refresh architecture baseline

This commit is contained in:
jxxghp
2026-11-21 22:37:01 +08:00
parent 10a46c1246
commit 50afccf193
3 changed files with 8 additions and 6 deletions

View File

@@ -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])

View File

@@ -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 层) |

View File

@@ -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",