From bb6ffd8ea90d09b429e0a0452f43cbbe472a9492 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Wed, 4 Mar 2026 22:57:01 +0800 Subject: [PATCH] feat: add FastAPI web map backend for weather data collection and analysis --- web/app.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/app.py b/web/app.py index b29973df..26cf93c1 100644 --- a/web/app.py +++ b/web/app.py @@ -349,6 +349,14 @@ def _analyze(city: str, force_refresh: bool = False) -> Dict[str, Any]: } cloud_desc = cloud_desc_map.get(mgc_cover, "") + # Final fallback: If we have ANY actual observation but no cloud info, it's usually clear. + if not cloud_desc: + if mc.get("temp") is not None or (mgm and mgm.get("current", {}).get("temp") is not None): + # If weather phenomenon exists (e.g. rain), we'll let app.js handle wx_desc priority. + # Otherwise, clear skies. + if not mc.get("wx_desc"): + cloud_desc = "晴朗" + # ── 14. MGM data (Ankara-specific) ── mgm_data = {} if mgm: