Loading lib/Travelynx/Helper/DBRIS.pm +15 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ use utf8; use DateTime; use Encode qw(decode); use JSON; use List::MoreUtils qw(firstval); use Mojo::Promise; use Mojo::UserAgent; use Travel::Status::DE::DBRIS; Loading Loading @@ -67,6 +68,20 @@ sub get_station_id_p { my $promise = Mojo::Promise->new; my $ds100_match = firstval { $station_name eq $_->[0] } Travel::Status::DE::IRIS::Stations::get_stations(); if ($ds100_match) { $promise->resolve({ eva => $ds100_match->[2], id => "A=1\@L=" . $ds100_match->[2] . "\@O=" . $ds100_match->[1] . "@", lat => $ds100_match->[4], lon => $ds100_match->[3], name => $ds100_match->[1], }); return $promise; } Travel::Status::DE::DBRIS->new_p( locationSearch => $station_name, cache => $self->{realtime_cache}, Loading Loading
lib/Travelynx/Helper/DBRIS.pm +15 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ use utf8; use DateTime; use Encode qw(decode); use JSON; use List::MoreUtils qw(firstval); use Mojo::Promise; use Mojo::UserAgent; use Travel::Status::DE::DBRIS; Loading Loading @@ -67,6 +68,20 @@ sub get_station_id_p { my $promise = Mojo::Promise->new; my $ds100_match = firstval { $station_name eq $_->[0] } Travel::Status::DE::IRIS::Stations::get_stations(); if ($ds100_match) { $promise->resolve({ eva => $ds100_match->[2], id => "A=1\@L=" . $ds100_match->[2] . "\@O=" . $ds100_match->[1] . "@", lat => $ds100_match->[4], lon => $ds100_match->[3], name => $ds100_match->[1], }); return $promise; } Travel::Status::DE::DBRIS->new_p( locationSearch => $station_name, cache => $self->{realtime_cache}, Loading