From aac8e2a0e1b870e9c40cecd15fd3d2fdfd484869 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 18 Sep 2019 18:08:06 +0200 Subject: Save scheduled arrival time for cancelled trains --- lib/Travelynx.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/Travelynx.pm') diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 7d3548e..860ba87 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -585,9 +585,10 @@ sub startup { ); } - if ( not( defined $train or $force ) ) { + if ( not defined $train ) { - # Arrival time via IRIS is unknown, try falling back to HAFAS + # Arrival time via IRIS is unknown, so the train probably has not + # arrived yet. Fall back to HAFAS. if ( my $station_data = first { $_->[0] eq $station } @{ $journey->{route} } ) { @@ -611,8 +612,10 @@ sub startup { ); } } - $self->run_hook( $uid, 'update' ); - return ( 1, undef ); + if ( not $force ) { + $self->run_hook( $uid, 'update' ); + return ( 1, undef ); + } } my $has_arrived = 0; -- cgit v1.2.3