diff options
Diffstat (limited to 'lib/Travelynx/Controller/Traveling.pm')
| -rwxr-xr-x | lib/Travelynx/Controller/Traveling.pm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index 6f8e905..154938d 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -1368,6 +1368,28 @@ sub station { station_name => $status->stop->full_name, related_stations => [], }; + my $backend_id + = $self->stations->get_backend_id( efa => $efa_service ); + my @destinations = $self->journeys->get_connection_targets( + uid => $uid, + backend_id => $backend_id, + eva => $status->{station_eva}, + ); + for my $dep (@results) { + destination: for my $dest (@destinations) { + for my $stop ( $dep->route_post ) { + if ( $stop->full_name eq $dest->{name} ) { + push( @suggestions, [ $dep, $dest ] ); + next destination; + } + } + } + } + + @suggestions = map { $_->[0] } + sort { $a->[1] <=> $b->[1] } + grep { $_->[1] >= $now - 300 and $_->[1] <= $now + 1800 } + map { [ $_, $_->[0]->datetime->epoch ] } @suggestions; } elsif ($motis_service) { @results = map { $_->[0] } @@ -1504,6 +1526,7 @@ sub station { related_stations => $status->{related_stations}, user_status => $user_status, can_check_out => $can_check_out, + suggestions => \@suggestions, title => "travelynx: $status->{station_name}", ); } |
