summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Helper/EFA.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-10-18 19:17:10 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-10-18 19:17:10 +0200
commit4dda0fd251e6c82c73cf7ae280caf1ae94d3012e (patch)
treef0301daaac4af07af8e5507d08cce8f1f05c0397 /lib/DBInfoscreen/Helper/EFA.pm
parentd8ffb5163a0f4bf543e5b026879cfff8ada0ab52 (diff)
Add preliminary EFA support
Diffstat (limited to 'lib/DBInfoscreen/Helper/EFA.pm')
-rw-r--r--lib/DBInfoscreen/Helper/EFA.pm13
1 files changed, 13 insertions, 0 deletions
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 ) = @_;