Normalize Wunderground labels to METAR

This commit is contained in:
2569718930@qq.com
2026-04-22 23:43:27 +08:00
parent e3a9f7fb00
commit fe804bc915
8 changed files with 81 additions and 34 deletions
+5 -1
View File
@@ -5,6 +5,7 @@ import {
HistoryPoint,
NearbyStation,
} from "@/lib/dashboard-types";
import { normalizeObservationSourceLabel } from "@/lib/source-labels";
const METAR_WX_MAP: Record<
string,
@@ -98,7 +99,10 @@ function getObservationSourceCode(detail: CityDetail): string {
}
function getObservationSourceTag(detail: CityDetail): string {
const label = String(detail.current?.settlement_source_label || "")
const label = normalizeObservationSourceLabel(
detail.current?.settlement_source_label,
"",
)
.trim()
.toUpperCase();
if (label) return label;