From a36801c967c790ed10d7d074af12f9832a42aa50 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Mon, 20 Nov 2023 17:17:13 +0100 Subject: perltidy --- lib/DBInfoscreen/Helper/EFA.pm | 6 ++---- lib/DBInfoscreen/Helper/HAFAS.pm | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 18 deletions(-) (limited to 'lib/DBInfoscreen/Helper') 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( -- cgit v1.2.3