From 465c131a6324c4c1d151d82829384652e1740238 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Tue, 20 Aug 2024 19:44:51 +0200 Subject: Backend selection: add coverage maps --- lib/DBInfoscreen/Helper/HAFAS.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/DBInfoscreen/Helper/HAFAS.pm') diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm index a55f03f..0400d59 100644 --- a/lib/DBInfoscreen/Helper/HAFAS.pm +++ b/lib/DBInfoscreen/Helper/HAFAS.pm @@ -28,6 +28,18 @@ sub new { } +sub get_coverage { + my ( $self, $service ) = @_; + + my $service_definition = Travel::Status::DE::HAFAS::get_service($service); + + if ( not $service_definition ) { + return {}; + } + + return $service_definition->{coverage}{area} // {}; +} + sub get_route_p { my ( $self, %opt ) = @_; -- cgit v1.2.3