add exact match notice on stations helper function

This commit is contained in:
Kaaninchen
2026-08-18 18:47:51 +02:00
parent bd506ff9da
commit 7a3902b7d3
+8 -6
View File
@@ -21,10 +21,9 @@ headers = {
endpoint = "https://api.transitous.org"
def check_stations():
logger(f"Testing {len(station_names)} stations...")
all_stations_output = {}
minimal_overview = {
"stations": {}
}
minimal_overview = {}
for station in station_names:
req = f"{endpoint}/api/v1/geocode"
@@ -54,8 +53,8 @@ def check_stations():
"tz": entry.get("tz"),
"country": entry.get("country"),
"coords": coords,
"modes": modes,
"id": station_id,
"modes": modes,
}
if stop_name:
@@ -64,7 +63,6 @@ def check_stations():
if stop_name == station:
if not exact_match:
logger(f"Exact match found! {station} is an assigned station! Bot would use that station directly")
exact_match = True
if not stops_dict:
@@ -72,10 +70,14 @@ def check_stations():
continue
all_stations_output[station] = {
"exact_match": exact_match,
"associated": stops_dict
}
minimal_overview["stations"][station] = aliases_list
minimal_overview[station] = {
"exact_match": exact_match,
"names": aliases_list
}
logger(json.dumps(minimal_overview, indent=4, ensure_ascii=False))