Tweaking find all metars

This commit is contained in:
2025-04-20 14:40:47 -04:00
parent d714287fd9
commit 19ed8ef2ca
5 changed files with 52 additions and 36 deletions

View File

@@ -214,7 +214,7 @@ impl Airport {
let metar_fut = async {
if metar {
match Metar::find_all(client, &vec![icao.to_string()], &false).await {
match Metar::find_all_distinct(client, &vec![icao.to_string()]).await {
Ok(m) => Some(m.into_iter().nth(0)),
Err(err) => {
log::error!("{}", err);
@@ -345,7 +345,7 @@ impl Airport {
let runway_future = Runway::select_all_map(icaos.clone());
let frequency_future = Frequency::select_all_map(icaos.clone());
let metar_future = if query.metars.unwrap_or(false) {
Some(Metar::find_all(client, &icaos, &false))
Some(Metar::find_all_distinct(client, &icaos))
} else {
None
};