diff options
author | Daniel Friesel <derf@finalrewind.org> | 2023-01-15 16:37:32 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2023-01-15 16:37:32 +0100 |
commit | 4abc43b72e597f7c441fc2c287ed38255a1f439b (patch) | |
tree | f02d83b69808ae0eee646dce978f2907d7488ab4 /lib/Travelynx/Model | |
parent | f198c96e308d6e1a5cb20ae2258befefb1254517 (diff) |
change route/stop layout to [name, eva, {data}]
Diffstat (limited to 'lib/Travelynx/Model')
-rwxr-xr-x | lib/Travelynx/Model/Journeys.pm | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm index f577236..0d47763 100755 --- a/lib/Travelynx/Model/Journeys.pm +++ b/lib/Travelynx/Model/Journeys.pm @@ -162,7 +162,7 @@ sub add { my @route; if ( not $route_has_start ) { - push( @route, [ $dep_station->{name}, {}, undef ] ); + push( @route, [ $dep_station->{name}, $dep_station->{eva}, {} ] ); } if ( $opt{route} ) { @@ -170,10 +170,11 @@ sub add { for my $station ( @{ $opt{route} } ) { my $station_info = $self->{stations}->search($station); if ($station_info) { - push( @route, [ $station_info->{name}, {}, undef ] ); + push( @route, + [ $station_info->{name}, $station_info->{eva}, {} ] ); } else { - push( @route, [ $station, {}, undef ] ); + push( @route, [ $station, undef, {} ] ); push( @unknown_stations, $station ); } } @@ -192,7 +193,7 @@ sub add { } if ( not $route_has_stop ) { - push( @route, [ $arr_station->{name}, {}, undef ] ); + push( @route, [ $arr_station->{name}, $arr_station->{eva}, {} ] ); } my $entry = { @@ -358,7 +359,7 @@ sub update { )->rows; } if ( exists $opt{route} ) { - my @new_route = map { [ $_, {}, undef ] } @{ $opt{route} }; + my @new_route = map { [ $_, undef, {} ] } @{ $opt{route} }; $rows = $db->update( 'journeys', { |