Added local flight duration

This commit is contained in:
2025-12-18 06:27:22 -05:00
parent f65c54109e
commit f572fb75f5
6 changed files with 33 additions and 5 deletions

View File

@@ -51,12 +51,18 @@ async def get_public_arrivals(db: Session = Depends(get_db)):
# Only include flights booked out today
if not (today_start <= flight.created_dt < today_end):
continue
# Calculate ETA from departed_dt + duration (if both are available)
eta = flight.departed_dt
if flight.departed_dt and flight.duration:
eta = flight.departed_dt + timedelta(minutes=flight.duration)
arrivals_list.append({
'ac_call': flight.callsign or flight.registration,
'ac_reg': flight.registration,
'ac_type': flight.type,
'in_from': None,
'eta': flight.departed_dt,
'eta': eta,
'landed_dt': None,
'status': 'DEPARTED',
'isLocalFlight': True,