修正非美国机场观测标签回退

This commit is contained in:
2569718930@qq.com
2026-06-16 20:40:49 +08:00
parent 135198e161
commit 1aa4fab6d8
2 changed files with 33 additions and 2 deletions
@@ -892,8 +892,10 @@ function airportPrimarySeriesLabel(
}
const payloadLabel = String(hourly?.airportPrimary?.source_label || "").trim();
if (payloadLabel && !isGenericAirportPrimaryLabel(payloadLabel)) return payloadLabel;
if (canonicalLabel === "NOAA MADIS" && !isUsAirportCode(airportCodeForSeriesLabel(hourly, row))) {
const stationCode = airportCodeForSeriesLabel(hourly, row);
const stationCode = airportCodeForSeriesLabel(hourly, row);
const isUsAirport = isUsAirportCode(stationCode);
if (!isUsAirport) {
if (canonicalLabel && canonicalLabel !== "NOAA MADIS") return canonicalLabel;
return stationCode ? `${stationCode} METAR` : "METAR";
}
return canonicalLabel || payloadLabel || "NOAA MADIS";