fix: 修复独立站日历节日去重与中文资料链接

This commit is contained in:
Jack
2026-08-17 12:58:19 +08:00
parent b1b7c13c97
commit 7af253f081
7 changed files with 15419 additions and 20828 deletions
+7
View File
@@ -157,6 +157,8 @@ def build_nager_events(now: date, horizon: date, source: SourceSpec, result: Fet
continue
local_title = normalize_text(str(row.get("localName") or ""))
english_title = normalize_text(str(row.get("name") or local_title or "公共假日"))
if english_title.lower().replace("’", "'") == "new year's day" and day.month == 12 and day.day == 31:
continue
title = market_holiday_title(local_title, english_title, code)
subdivision_codes = [normalize_text(str(value)) for value in row.get("counties") or [] if value]
applicable_areas, country_scope = calendar_scope(bool(row.get("global", True)), subdivision_codes)
@@ -183,6 +185,11 @@ def build_nager_events(now: date, horizon: date, source: SourceSpec, result: Fet
"source_url": event_source_url,
"authority": "结构化公共假日数据",
})
item.update(translation_fields(
event_source_url,
"zh-CN" if code == "CN" else "en",
local_title or english_title,
))
items.append(enrich_market_calendar_item(item, now, code, poster_for))
return items
def build_govuk_events(now: date, horizon: date, source: SourceSpec, result: FetchResult) -> list[dict[str, Any]]: