auto-sync: 2026-04-21 01:20:01

This commit is contained in:
Stream
2026-04-21 01:20:01 +03:00
parent da6c84744d
commit 8696a05670

View File

@@ -215,10 +215,17 @@ def _parse_item(item: Dict, direction: str, airport_iata: str) -> Optional[Dict]
if duration_min is None and direction == "arrival":
dep_dt = _parse_dt(item.get("departure"))
arr_dt = _parse_dt(item.get("arrival"))
# For arrival records, 'arrival' field is often None,
# but scheduled_at IS the arrival time in this airport
arr_dt = _parse_dt(item.get("arrival")) or scheduled_at
if dep_dt and arr_dt and arr_dt > dep_dt:
duration_min = (arr_dt - dep_dt).total_seconds() / 60.0
if duration_min is None and direction == "departure":
# For departure records, 'arrival' field is None,
# but we can try to find the matching arrival record later via SQL
pass
return {
"flight_number": flight_number,
"airline_iata": carrier.get("code"),