diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Travelynx.pm | 8 | ||||
-rw-r--r-- | lib/Travelynx/Helper/IRIS.pm | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 0c8d0f2..4a929f4 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -1409,6 +1409,14 @@ sub startup { my ( $new_route, $journey, $polyline ) = @_; my $db_route; + for my $stop ( $journey->route ) { + $self->stations->add_or_update( + stop => $stop, + db => $db, + iris => 1, + ); + } + for my $i ( 0 .. $#{$new_route} ) { my $old_name = $route->[$i][0]; my $old_eva = $route->[$i][1]; diff --git a/lib/Travelynx/Helper/IRIS.pm b/lib/Travelynx/Helper/IRIS.pm index f96aeb6..34739eb 100644 --- a/lib/Travelynx/Helper/IRIS.pm +++ b/lib/Travelynx/Helper/IRIS.pm @@ -41,6 +41,10 @@ sub get_departures { my @station_matches = Travel::Status::DE::IRIS::Stations::get_station($station); + if ( $station =~ m{ ^ \d+ $ }x ) { + @station_matches = ( [ undef, undef, $station ] ); + } + if ( @station_matches == 1 ) { $station = $station_matches[0][2]; my $status = Travel::Status::DE::IRIS->new( @@ -108,6 +112,10 @@ sub get_departures_p { my @station_matches = Travel::Status::DE::IRIS::Stations::get_station($station); + if ( $station =~ m{ ^ \d+ $ }x ) { + @station_matches = ( [ undef, undef, $station ] ); + } + if ( @station_matches == 1 ) { $station = $station_matches[0][2]; my $promise = Mojo::Promise->new; |