summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Model/Journeys.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-10-01 10:49:36 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-10-01 10:49:36 +0200
commitcbc433f76c13c1eaa2ed5f7b4dddc51e421153ec (patch)
tree094f2275f6be80be503f8a9eebc3d9773908cbb3 /lib/Travelynx/Model/Journeys.pm
parent4a2897c1f812d3deb3b799b8c10b67dd2d1f11f6 (diff)
suggested connections: avoid fetching IRIS trains via HAFAS
Diffstat (limited to 'lib/Travelynx/Model/Journeys.pm')
-rwxr-xr-xlib/Travelynx/Model/Journeys.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm
index 3f2c0dd..5fa7e56 100755
--- a/lib/Travelynx/Model/Journeys.pm
+++ b/lib/Travelynx/Model/Journeys.pm
@@ -1726,13 +1726,16 @@ sub get_connection_targets {
my $min_count = $opt{min_count} // 3;
if ( $opt{destination_name} ) {
- return ( { eva => $opt{eva}, name => $opt{destination_name} } );
+ return (
+ [],
+ [ { eva => $opt{eva}, name => $opt{destination_name} } ]
+ );
}
my $dest_id = $opt{eva} // $self->get_latest_dest_id(%opt);
if ( not $dest_id ) {
- return;
+ return ( [], [] );
}
my $dest_ids = [ $dest_id, $self->{stations}->get_meta( eva => $dest_id ) ];
@@ -1754,7 +1757,7 @@ sub get_connection_targets {
= $res->hashes->grep( sub { shift->{count} >= $min_count } )
->map( sub { shift->{dest} } )->each;
@destinations = $self->{stations}->get_by_evas(@destinations);
- return @destinations;
+ return ( $dest_ids, \@destinations );
}
sub update_visibility {