diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2022-12-08 18:22:09 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2022-12-08 18:22:09 +0100 |
commit | 115e07f35c8bbd7409f32aa7f9f89fe222a67b0f (patch) | |
tree | a43eb26875adfbcf07cb8b60777a3aa2b0f65242 /lib/Travelynx.pm | |
parent | afedcef2663ceda6d4a9b88af702c04eb4eb0f4a (diff) |
move grep_unknown_stations to Stations model
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-x | lib/Travelynx.pm | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 8d661d2..4195001 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -420,21 +420,6 @@ sub startup { ); $self->helper( - 'grep_unknown_stations' => sub { - my ( $self, @stations ) = @_; - - my @unknown_stations; - for my $station (@stations) { - my $station_info = $self->stations->get_by_name($station); - if ( not $station_info ) { - push( @unknown_stations, $station ); - } - } - return @unknown_stations; - } - ); - - $self->helper( 'load_icon' => sub { my ( $self, $load ) = @_; my $first = $load->{FIRST} // 0; @@ -750,7 +735,7 @@ sub startup { $has_arrived = $train->arrival->epoch < $now->epoch ? 1 : 0; if ($has_arrived) { my @unknown_stations - = $self->grep_unknown_stations( $train->route ); + = $self->stations->grep_unknown( $train->route ); if (@unknown_stations) { $self->app->log->warn( sprintf( |