summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-10-30 17:14:21 +0100
committerDaniel Friesel <derf@finalrewind.org>2022-10-30 17:14:21 +0100
commit4dbbedaf6bd953e5d57023eefc3acf742e91f511 (patch)
tree17161670d4758b096840ee77c77b1378ce595d1d /lib/DBInfoscreen
parent6b5d0f8bcc7ea7c76093803cbf8d52d8a0b0a377 (diff)
Move EFA code to separate helper class
Diffstat (limited to 'lib/DBInfoscreen')
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm2
-rw-r--r--lib/DBInfoscreen/Helper/EFA.pm (renamed from lib/DBInfoscreen/Helper/Marudor.pm)12
-rw-r--r--lib/DBInfoscreen/Helper/HAFAS.pm2
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 5a8c44e..735cbe7 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -597,7 +597,7 @@ sub render_train {
$wagonorder_req->resolve;
}
- $self->marudor->get_efa_occupancy(
+ $self->efa->get_efa_occupancy(
eva => $result->station_uic,
train_no => $result->train_no
)->then(
diff --git a/lib/DBInfoscreen/Helper/Marudor.pm b/lib/DBInfoscreen/Helper/EFA.pm
index 352829b..2386ebb 100644
--- a/lib/DBInfoscreen/Helper/Marudor.pm
+++ b/lib/DBInfoscreen/Helper/EFA.pm
@@ -1,6 +1,6 @@
-package DBInfoscreen::Helper::Marudor;
+package DBInfoscreen::Helper::EFA;
-# Copyright (C) 2020 Daniel Friesel
+# Copyright (C) 2020-2022 Daniel Friesel
#
# SPDX-License-Identifier: AGPL-3.0-or-later
@@ -35,7 +35,7 @@ sub get_json_p {
my $promise = Mojo::Promise->new;
if ( my $content = $cache->thaw($url) ) {
- $self->{log}->debug("marudor->get_json_p($url): cached");
+ $self->{log}->debug("efa->get_json_p($url): cached");
if ( $content->{error} ) {
return $promise->reject( $content->{error} );
}
@@ -49,7 +49,7 @@ sub get_json_p {
if ( my $err = $tx->error ) {
$self->{log}->debug(
-"marudor->get_json_p($url): HTTP $err->{code} $err->{message}"
+"efa->get_json_p($url): HTTP $err->{code} $err->{message}"
);
$cache->freeze( $url, { error => $err->{message} } );
$promise->reject(
@@ -61,7 +61,7 @@ sub get_json_p {
if ( not $res ) {
$self->{log}
- ->debug("marudor->get_json_p($url): empty response");
+ ->debug("efa->get_json_p($url): empty response");
$promise->reject("GET $url returned empty response");
return;
}
@@ -75,7 +75,7 @@ sub get_json_p {
)->catch(
sub {
my ($err) = @_;
- $self->{log}->debug("marudor->get_json_p($url): $err");
+ $self->{log}->debug("efa->get_json_p($url): $err");
$cache->freeze( $url, { error => $err } );
$promise->reject($err);
return;
diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm
index 2fb088a..28f5f02 100644
--- a/lib/DBInfoscreen/Helper/HAFAS.pm
+++ b/lib/DBInfoscreen/Helper/HAFAS.pm
@@ -1,6 +1,6 @@
package DBInfoscreen::Helper::HAFAS;
-# Copyright (C) 2011-2020 Daniel Friesel
+# Copyright (C) 2011-2022 Daniel Friesel
#
# SPDX-License-Identifier: AGPL-3.0-or-later