Add PC post-match player pages with opt-in public OSS sync.

Generate /players/{account_id}[/{match_id}] locally after POST_GAME via OpenDota; publish to OSS only when public_share is enabled.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
voson
2026-07-31 11:01:32 +08:00
co-authored by Cursor
parent d6f7c3f0f5
commit 4a61aeeb26
16 changed files with 1684 additions and 23 deletions
+7 -3
View File
@@ -55,7 +55,7 @@ from shared.paths import (
from seo_prerender import DEFAULT_SITE_ORIGIN, write_seo_bundle
from serve_relations import WEB_DIR, build_payload
SITE_VERSION = "0.6.15"
SITE_VERSION = "0.6.16"
DEFAULT_OSS_BASE = "https://climperor.oss-cn-shanghai.aliyuncs.com"
@@ -149,10 +149,12 @@ def write_config_js(
static_asset_base: str,
site_version: str,
site_origin: str,
players_asset_base: str = "",
) -> None:
"""Write config.js consumed by app.js."""
video = (ability_video_base or "").strip().rstrip("/")
static = (static_asset_base or "").strip().rstrip("/")
players = (players_asset_base or "").strip().rstrip("/") or static
ver = (site_version or "").strip()
origin = (site_origin or "").strip().rstrip("/")
(out / "config.js").write_text(
@@ -160,7 +162,8 @@ def write_config_js(
f"var SITE_VERSION = {json.dumps(ver, ensure_ascii=False)};\n"
f"var SITE_ORIGIN = {json.dumps(origin, ensure_ascii=False)};\n"
f"var ABILITY_VIDEO_BASE = {json.dumps(video, ensure_ascii=False)};\n"
f"var STATIC_ASSET_BASE = {json.dumps(static, ensure_ascii=False)};\n",
f"var STATIC_ASSET_BASE = {json.dumps(static, ensure_ascii=False)};\n"
f"var PLAYERS_ASSET_BASE = {json.dumps(players, ensure_ascii=False)};\n",
encoding="utf-8",
)
@@ -305,7 +308,8 @@ def main() -> None:
print(f" ability-video/: {n_videos} files")
print(
f" config.js SITE_VERSION={SITE_VERSION!r} SITE_ORIGIN={site_origin!r} "
f"ABILITY_VIDEO_BASE={video_base!r} STATIC_ASSET_BASE={static_base!r}"
f"ABILITY_VIDEO_BASE={video_base!r} STATIC_ASSET_BASE={static_base!r} "
f"PLAYERS_ASSET_BASE={static_base!r}"
)
print(f" total: {total / 1e6:.1f} MB")
print(