diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 8c8365f..7d4a25d 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -241,11 +241,17 @@ sub result_has_train_type { sub result_has_via { my ( $result, $via ) = @_; - my @route - = $result->can('route_post') - ? ( $result->route_post, $result->sched_route_post ) - : map { $_->loc->name } $result->route; + my @route; + if ( $result->isa('Travel::Status::DE::IRIS::Result') ) { + @route = ( $result->route_post, $result->sched_route_post ); + } + elsif ( $result->isa('Travel::Status::DE::HAFAS::Journey') ) { + @route = map { $_->loc->name } $result->route; + } + elsif ( $result->isa('Travel::Status::DE::EFA::Departure') ) { + @route = map { $_->full_name } $result->route_post; + } my $eq_result = List::MoreUtils::any { lc eq lc($via) } @route; if ($eq_result) { @@ -1692,7 +1698,9 @@ sub handle_efa { delete $self->stash->{layout}; } - for my $result ( $efa->results ) { + my @results = $self->filter_results( $efa->results ); + + for my $result (@results) { my $time; if ( $template eq 'json' ) { |