mirror of
https://github.com/derf/travelynx
synced 2025-02-27 20:57:09 +00:00
connecting trains: HAFAS: Handle delay and pass it to frontend
This commit is contained in:
parent
4a96cf1f47
commit
f3ad5a5ef3
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue