diff options
| author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-12-04 21:06:39 +0100 |
|---|---|---|
| committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-12-04 21:06:39 +0100 |
| commit | 9c2e83fcaacc760df8815169ba0e805cfc5c199c (patch) | |
| tree | f83628d89f582e7d7c67ba21e7bcc78792a804d3 /lib | |
| parent | 1ed38fb0ba23389338a4eba439fc9ab521564fda (diff) | |
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/Travelynx/Model/Journeys.pm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm index e0f1e83..bce475f 100755 --- a/lib/Travelynx/Model/Journeys.pm +++ b/lib/Travelynx/Model/Journeys.pm @@ -2150,10 +2150,15 @@ sub get_connection_targets { order_by => { -desc => 'count' } } ); - my @destinations - = $res->hashes->grep( sub { shift->{count} >= $min_count } ) - ->map( sub { shift->{dest} } ) - ->each; + my @all_destinations = $res->hashes->each; + my @destinations; + + while ( not @destinations and $min_count > 0 ) { + @destinations = map { $_->{dest} } + grep { $_->{count} >= $min_count } @all_destinations; + $min_count--; + } + @destinations = $self->{stations}->get_by_evas( backend_id => $opt{backend_id}, evas => [@destinations] |
