From 4abc43b72e597f7c441fc2c287ed38255a1f439b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 15 Jan 2023 16:37:32 +0100 Subject: change route/stop layout to [name, eva, {data}] --- lib/Travelynx/Model/Journeys.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/Travelynx/Model/Journeys.pm') 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', { -- cgit v1.2.3