V10.514 新增 Webcrumbs host data API
All checks were successful
CD Pipeline / deploy (push) Successful in 1m10s

This commit is contained in:
OoO
2026-05-31 20:56:14 +08:00
parent 89d8c454bb
commit f3a3cfe52a
8 changed files with 52 additions and 6 deletions

View File

@@ -62,9 +62,10 @@ def _is_blocked_external_url(configured_url):
return parsed.scheme in {"http", "https"} and parsed.hostname != "mo.wooo.work"
def _webcrumbs_seed_data():
def build_webcrumbs_seed_data(limit: int = 5):
"""Build safe Webcrumbs host data for page seed and read-only API."""
try:
return build_webcrumbs_marketplace_host_data(limit=5)
return build_webcrumbs_marketplace_host_data(limit=limit)
except Exception as exc:
sys_log.warning(f"[Webcrumbs] host data build skipped: {exc}")
return {
@@ -170,7 +171,7 @@ def _webcrumbs_payload():
],
"plugin_previews": plugin_previews,
"plugin_preview_uris": [preview["uri"] for preview in plugin_previews],
"plugin_seed_data": _webcrumbs_seed_data(),
"plugin_seed_data": build_webcrumbs_seed_data(limit=5),
}