From 4dda0fd251e6c82c73cf7ae280caf1ae94d3012e Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 18 Oct 2024 19:17:10 +0200 Subject: Add preliminary EFA support --- lib/DBInfoscreen/Helper/EFA.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/DBInfoscreen/Helper') diff --git a/lib/DBInfoscreen/Helper/EFA.pm b/lib/DBInfoscreen/Helper/EFA.pm index 4e81bc3..13944cd 100644 --- a/lib/DBInfoscreen/Helper/EFA.pm +++ b/lib/DBInfoscreen/Helper/EFA.pm @@ -13,6 +13,7 @@ use Encode qw(decode encode); use Mojo::JSON qw(decode_json); use Mojo::Promise; use Mojo::Util qw(url_escape); +use Travel::Status::DE::EFA; sub new { my ( $class, %opt ) = @_; @@ -28,6 +29,18 @@ sub new { } +sub get_coverage { + my ( $self, $service ) = @_; + + my $service_definition = Travel::Status::DE::EFA::get_service($service); + + if ( not $service_definition ) { + return {}; + } + + return $service_definition->{coverage}{area} // {}; +} + sub get_json_p { my ( $self, $cache, $url ) = @_; -- cgit v1.2.3