Loading lib/Travel/Routing/DE/HAFAS.pm +47 −65 Original line number Original line Diff line number Diff line Loading @@ -216,9 +216,6 @@ sub new { my $req; my $req; if (0) { } else { my $date = ( $conf{datetime} // $now )->strftime('%Y%m%d'); my $date = ( $conf{datetime} // $now )->strftime('%Y%m%d'); my $time = ( $conf{datetime} // $now )->strftime('%H%M%S'); my $time = ( $conf{datetime} // $now )->strftime('%H%M%S'); Loading Loading @@ -266,7 +263,6 @@ sub new { ], ], %{ $hafas_instance{$service}{request} } %{ $hafas_instance{$service}{request} } }; }; } if ( $conf{language} ) { if ( $conf{language} ) { $req->{lang} = $conf{language}; $req->{lang} = $conf{language}; Loading Loading @@ -338,14 +334,9 @@ sub new_p { my ( $obj, %conf ) = @_; my ( $obj, %conf ) = @_; my $promise = $conf{promise}->new; my $promise = $conf{promise}->new; if ( if ( not( $conf{from_stop} and $conf{to_stop} ) ) { not( $conf{station} confess('from_stop and to_stop must be specified'); or $conf{journey} return $promise->reject('from_stop and to_stop must be specified'); or $conf{geoSearch} or $conf{locationSearch} ) ) { return $promise->reject('station or journey flag must be passed'); } } my $self = $obj->new( %conf, async => 1 ); my $self = $obj->new( %conf, async => 1 ); Loading @@ -356,15 +347,7 @@ sub new_p { my ($content) = @_; my ($content) = @_; $self->{raw_json} = $self->{json}->decode($content); $self->{raw_json} = $self->{json}->decode($content); $self->check_mgate; $self->check_mgate; if ( $conf{journey} ) { $self->parse_trips; $self->parse_journey; } elsif ( $conf{geoSearch} or $conf{locationSearch} ) { $self->parse_search; } else { $self->parse_board; } if ( $self->errstr ) { if ( $self->errstr ) { $promise->reject( $self->errstr, $self ); $promise->reject( $self->errstr, $self ); } } Loading Loading @@ -448,7 +431,6 @@ sub post_with_cache { my $content = $reply->content; my $content = $reply->content; if ($cache) { if ($cache) { say "freeeez"; $cache->freeze( $self->{post}, \$content ); $cache->freeze( $self->{post}, \$content ); } } Loading Loading
lib/Travel/Routing/DE/HAFAS.pm +47 −65 Original line number Original line Diff line number Diff line Loading @@ -216,9 +216,6 @@ sub new { my $req; my $req; if (0) { } else { my $date = ( $conf{datetime} // $now )->strftime('%Y%m%d'); my $date = ( $conf{datetime} // $now )->strftime('%Y%m%d'); my $time = ( $conf{datetime} // $now )->strftime('%H%M%S'); my $time = ( $conf{datetime} // $now )->strftime('%H%M%S'); Loading Loading @@ -266,7 +263,6 @@ sub new { ], ], %{ $hafas_instance{$service}{request} } %{ $hafas_instance{$service}{request} } }; }; } if ( $conf{language} ) { if ( $conf{language} ) { $req->{lang} = $conf{language}; $req->{lang} = $conf{language}; Loading Loading @@ -338,14 +334,9 @@ sub new_p { my ( $obj, %conf ) = @_; my ( $obj, %conf ) = @_; my $promise = $conf{promise}->new; my $promise = $conf{promise}->new; if ( if ( not( $conf{from_stop} and $conf{to_stop} ) ) { not( $conf{station} confess('from_stop and to_stop must be specified'); or $conf{journey} return $promise->reject('from_stop and to_stop must be specified'); or $conf{geoSearch} or $conf{locationSearch} ) ) { return $promise->reject('station or journey flag must be passed'); } } my $self = $obj->new( %conf, async => 1 ); my $self = $obj->new( %conf, async => 1 ); Loading @@ -356,15 +347,7 @@ sub new_p { my ($content) = @_; my ($content) = @_; $self->{raw_json} = $self->{json}->decode($content); $self->{raw_json} = $self->{json}->decode($content); $self->check_mgate; $self->check_mgate; if ( $conf{journey} ) { $self->parse_trips; $self->parse_journey; } elsif ( $conf{geoSearch} or $conf{locationSearch} ) { $self->parse_search; } else { $self->parse_board; } if ( $self->errstr ) { if ( $self->errstr ) { $promise->reject( $self->errstr, $self ); $promise->reject( $self->errstr, $self ); } } Loading Loading @@ -448,7 +431,6 @@ sub post_with_cache { my $content = $reply->content; my $content = $reply->content; if ($cache) { if ($cache) { say "freeeez"; $cache->freeze( $self->{post}, \$content ); $cache->freeze( $self->{post}, \$content ); } } Loading