移除不准确的今日最高,改为按当前温度从高到低排序
- airport_obs_log 仅保留 2h 数据,max_so_far 不准确 - 去掉卡片 Today High 行,趋势箭头移到 Obs 同行 - 卡片按 current_temp 降序排列,无数据沉底 - 通知文案简化
This commit is contained in:
@@ -127,11 +127,18 @@ fn load_city_snapshot(db_path: &str, idx: usize, (key, _zh, en, icao, airport, t
|
||||
}
|
||||
|
||||
fn load_all_cities(db_path: &str) -> Vec<CitySnapshot> {
|
||||
CITIES
|
||||
let mut cities: Vec<CitySnapshot> = CITIES
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, c)| load_city_snapshot(db_path, i, c))
|
||||
.collect()
|
||||
.collect();
|
||||
// 按当前温度从高到低排序,无数据的排最后
|
||||
cities.sort_by(|a, b| {
|
||||
b.current_temp
|
||||
.partial_cmp(&a.current_temp)
|
||||
.unwrap_or(std::cmp::Ordering::Less)
|
||||
});
|
||||
cities
|
||||
}
|
||||
|
||||
// ── routes ──
|
||||
|
||||
Reference in New Issue
Block a user