Loading lib/DBInfoscreen/Controller/Stationboard.pm +1 −11 Original line number Diff line number Diff line Loading @@ -1300,17 +1300,7 @@ sub train_details_dbris { $self->render_later; Travel::Status::DE::DBRIS->new_p( journey => $trip_id, cache => $self->app->cache_iris_rt, lwp_options => { timeout => 10, agent => 'dbf.finalrewind.org/2' }, promise => 'Mojo::Promise', user_agent => Mojo::UserAgent->new, developer_mode => 1, )->then( $self->dbris->get_journey_p( id => $trip_id )->then( sub { my ($dbris) = @_; my $trip = $dbris->result; Loading lib/DBInfoscreen/Helper/DBRIS.pm +19 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,25 @@ sub new { } sub get_journey_p { my ( $self, %opt ) = @_; my $agent = $self->{user_agent}; if ( my $proxy = $ENV{DBFAKEDISPLAY_DBRIS_PROXY} ) { $agent = Mojo::UserAgent->new; $agent->proxy->http($proxy); $agent->proxy->https($proxy); } return Travel::Status::DE::DBRIS->new_p( journey => $opt{id}, cache => $self->{realtime_cache}, promise => 'Mojo::Promise', user_agent => $agent->request_timeout(10) ); } # Input: TripID # Output: Promise returning a Travel::Status::DE::DBRIS::Journey instance on success sub get_polyline_p { Loading @@ -40,7 +59,6 @@ sub get_polyline_p { my $agent = $self->{user_agent}; if ( my $proxy = $ENV{DBFAKEDISPLAY_DBRIS_PROXY} ) { say "set up proxy $proxy"; $agent = Mojo::UserAgent->new; $agent->proxy->http($proxy); $agent->proxy->https($proxy); Loading Loading
lib/DBInfoscreen/Controller/Stationboard.pm +1 −11 Original line number Diff line number Diff line Loading @@ -1300,17 +1300,7 @@ sub train_details_dbris { $self->render_later; Travel::Status::DE::DBRIS->new_p( journey => $trip_id, cache => $self->app->cache_iris_rt, lwp_options => { timeout => 10, agent => 'dbf.finalrewind.org/2' }, promise => 'Mojo::Promise', user_agent => Mojo::UserAgent->new, developer_mode => 1, )->then( $self->dbris->get_journey_p( id => $trip_id )->then( sub { my ($dbris) = @_; my $trip = $dbris->result; Loading
lib/DBInfoscreen/Helper/DBRIS.pm +19 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,25 @@ sub new { } sub get_journey_p { my ( $self, %opt ) = @_; my $agent = $self->{user_agent}; if ( my $proxy = $ENV{DBFAKEDISPLAY_DBRIS_PROXY} ) { $agent = Mojo::UserAgent->new; $agent->proxy->http($proxy); $agent->proxy->https($proxy); } return Travel::Status::DE::DBRIS->new_p( journey => $opt{id}, cache => $self->{realtime_cache}, promise => 'Mojo::Promise', user_agent => $agent->request_timeout(10) ); } # Input: TripID # Output: Promise returning a Travel::Status::DE::DBRIS::Journey instance on success sub get_polyline_p { Loading @@ -40,7 +59,6 @@ sub get_polyline_p { my $agent = $self->{user_agent}; if ( my $proxy = $ENV{DBFAKEDISPLAY_DBRIS_PROXY} ) { say "set up proxy $proxy"; $agent = Mojo::UserAgent->new; $agent->proxy->http($proxy); $agent->proxy->https($proxy); Loading