From 6dab985966f2a67a9acfdc5b442b16d5e65b7079 Mon Sep 17 00:00:00 2001 From: networkException Date: Fri, 18 Apr 2025 12:27:41 +0200 Subject: Initial MOTIS backend support This patch adds support for displaying coverage and trip maps for MOTIS. --- lib/DBInfoscreen.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/DBInfoscreen.pm') diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index b0bac14..18a2c87 100644 --- a/lib/DBInfoscreen.pm +++ b/lib/DBInfoscreen.pm @@ -10,6 +10,7 @@ use Cache::File; use DBInfoscreen::Helper::DBRIS; use DBInfoscreen::Helper::EFA; use DBInfoscreen::Helper::HAFAS; +use DBInfoscreen::Helper::MOTIS; use DBInfoscreen::Helper::Wagonorder; use File::Slurp qw(read_file); use JSON; @@ -106,6 +107,20 @@ sub startup { } ); + $self->helper( + motis => sub { + my ($self) = @_; + state $motis = DBInfoscreen::Helper::MOTIS->new( + log => $self->app->log, + main_cache => $self->app->cache_iris_main, + realtime_cache => $self->app->cache_iris_rt, + root_url => $self->url_for('/')->to_abs, + user_agent => $self->ua, + version => $self->config->{version}, + ); + } + ); + $self->helper( efa => sub { my ($self) = @_; -- cgit v1.2.3