Unverified Commit f3ad5a5e authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

connecting trains: HAFAS: Handle delay and pass it to frontend

parent 4a96cf1f
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -326,6 +326,16 @@ sub get_connecting_trains_p {
									my $arrival
									  = $strp->parse_datetime(
										$stop->{arrival} );
									my $delay = undef;
									if ( defined $hafas_train->{delay} ) {
										$delay = $hafas_train->{delay} / 60;
										if (    $delay
											and $stop->{arrival} eq
											$stop->{plannedArrival} )
										{
											$arrival->add( minutes => $delay );
										}
									}
									if ( $departure->epoch >= $exclude_before )
									{
										$via_count{$dest}++;
@@ -337,6 +347,7 @@ sub get_connecting_trains_p {
													  $hafas_train->{line}
													  {name},
													departure => $departure,
													departure_delay => $delay
												},
												$dest, $arrival
											]