diff options
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-x | lib/Travelynx.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index f9199a5..e154e8d 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -441,6 +441,7 @@ sub startup { my $station = $opt{station}; my $train_id = $opt{train_id}; + my $ts = $opt{ts}; my $uid = $opt{uid} // $self->current_user->{id}; my $db = $opt{db} // $self->pg->db; my $hafas; @@ -534,6 +535,7 @@ sub startup { my $station = $opt{station}; my $train_id = $opt{train_id}; + my $ts = $opt{ts}; my $uid = $opt{uid} // $self->current_user->{id}; my $db = $opt{db} // $self->pg->db; my $hafas; @@ -553,7 +555,13 @@ sub startup { or $stop->loc->eva == $station ) { $found = $stop; - last; + + # Lines may serve the same stop several times. + # Keep looking until the scheduled departure + # matches the one passed while checking in. + if ( $ts and $stop->sched_dep->epoch == $ts ) { + last; + } } } if ( not $found ) { |