summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Helper
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-11-20 17:17:13 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2023-11-20 17:17:13 +0100
commita36801c967c790ed10d7d074af12f9832a42aa50 (patch)
tree47b049254dc569907f64ab5acee91291bb0ba23a /lib/DBInfoscreen/Helper
parent7477ab8a571f72f0af08530d4414e1811bd4c0c8 (diff)
perltidy
Diffstat (limited to 'lib/DBInfoscreen/Helper')
-rw-r--r--lib/DBInfoscreen/Helper/EFA.pm6
-rw-r--r--lib/DBInfoscreen/Helper/HAFAS.pm28
2 files changed, 16 insertions, 18 deletions
diff --git a/lib/DBInfoscreen/Helper/EFA.pm b/lib/DBInfoscreen/Helper/EFA.pm
index 41035d4..2a7416e 100644
--- a/lib/DBInfoscreen/Helper/EFA.pm
+++ b/lib/DBInfoscreen/Helper/EFA.pm
@@ -49,8 +49,7 @@ sub get_json_p {
if ( my $err = $tx->error ) {
$self->{log}->debug(
-"efa->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(
"GET $url returned HTTP $err->{code} $err->{message}");
@@ -60,8 +59,7 @@ sub get_json_p {
my $res = $tx->res->json;
if ( not $res ) {
- $self->{log}
- ->debug("efa->get_json_p($url): empty response");
+ $self->{log}->debug("efa->get_json_p($url): empty response");
$promise->reject("GET $url returned empty response");
return;
}
diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm
index 66a43df..e5c82e7 100644
--- a/lib/DBInfoscreen/Helper/HAFAS.pm
+++ b/lib/DBInfoscreen/Helper/HAFAS.pm
@@ -115,19 +115,19 @@ sub trainsearch_p {
# Try finding a result for the current date
for my $suggestion ( @{ $trainsearch->{suggestions} // [] } ) {
- # Drunken API, sail with care. Both date formats are used interchangeably
+ # Drunken API, sail with care. Both date formats are used interchangeably
if (
exists $suggestion->{depDate}
and ( $suggestion->{depDate} eq $opt{date_yy}
or $suggestion->{depDate} eq $opt{date_yyyy} )
)
{
- # Train numbers are not unique, e.g. IC 149 refers both to the
- # InterCity service Amsterdam -> Berlin and to the InterCity service
- # Koebenhavns Lufthavn st -> Aarhus. One workaround is making
- # requests with the stationFilter=80 parameter. Checking the origin
- # station seems to be the more generic solution, so we do that
- # instead.
+ # Train numbers are not unique, e.g. IC 149 refers both to the
+ # InterCity service Amsterdam -> Berlin and to the InterCity service
+ # Koebenhavns Lufthavn st -> Aarhus. One workaround is making
+ # requests with the stationFilter=80 parameter. Checking the origin
+ # station seems to be the more generic solution, so we do that
+ # instead.
if ( $opt{train_origin}
and $suggestion->{dep} eq $opt{train_origin} )
{
@@ -139,10 +139,10 @@ sub trainsearch_p {
if ($result) {
- # The trip_id's date part doesn't seem to matter -- so far, HAFAS is
- # happy as long as the date part starts with a number. HAFAS-internal
- # tripIDs use this format (withouth leading zero for day of month < 10)
- # though, so let's stick with it.
+ # The trip_id's date part doesn't seem to matter -- so far, HAFAS is
+ # happy as long as the date part starts with a number. HAFAS-internal
+ # tripIDs use this format (withouth leading zero for day of month < 10)
+ # though, so let's stick with it.
my $date_map = $opt{date_yyyy};
$date_map =~ tr{.}{}d;
$result->{trip_id} = sprintf( '1|%d|%d|%d|%s',
@@ -156,9 +156,9 @@ sub trainsearch_p {
$promise->reject("Zug $opt{train_req} nicht gefunden");
}
- # do not propagate $promise->reject's return value to this promise.
- # Perl implicitly returns the last statement, so we explicitly return
- # nothing to avoid this.
+ # do not propagate $promise->reject's return value to this promise.
+ # Perl implicitly returns the last statement, so we explicitly return
+ # nothing to avoid this.
return;
}
)->catch(