Added local flight duration
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user