diff options
Diffstat (limited to 'lib/DBInfoscreen/Controller')
-rw-r--r-- | lib/DBInfoscreen/Controller/Map.pm | 30 | ||||
-rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 23 |
2 files changed, 30 insertions, 23 deletions
diff --git a/lib/DBInfoscreen/Controller/Map.pm b/lib/DBInfoscreen/Controller/Map.pm index 28b949c..0a597e1 100644 --- a/lib/DBInfoscreen/Controller/Map.pm +++ b/lib/DBInfoscreen/Controller/Map.pm @@ -32,7 +32,7 @@ sub get_route_indexes { for my $i ( 0 .. $#{$polyline} ) { my $this_point = $polyline->[$i]; - my $name = $this_point->{name} // $this_point->{stop}->{name}; + my $name = $this_point->{name} // $this_point->{stop}->{name}; if ( not defined $from_index and $name @@ -324,12 +324,15 @@ sub route_efa { my $backend = $self->param('efa'); my $stopseq; - if ( $trip_id =~ m{ ^ ([^@]*) @ ([^@]*) [(] ([^)]*) [)] (.*) $ }x ) { + if ( $trip_id + =~ m{ ^ ([^@]*) @ ([^@]*) [(] ([^T]*) T ([^)]*) [)] (.*) $ }x ) + { $stopseq = { stateless => $1, stop_id => $2, date => $3, - key => $4 + time => $4, + key => $5 }; } else { @@ -678,7 +681,7 @@ sub route_motis { # Prepare from/to markers and name/time/delay overlays for stations for my $stopover (@stopovers) { - my $stop = $stopover->stop; + my $stop = $stopover->stop; my @stop_lines = ( $stop->name ); if ( $from_name and $stop->name eq $from_name ) { @@ -708,16 +711,20 @@ sub route_motis { push( @stop_lines, 'Gleis ' . $stop->track ); } if ( $stopover->arrival ) { - my $arr_line = $stopover->arrival->strftime('Ankunft: %H:%M'); + my $arr_line + = $stopover->arrival->strftime('Ankunft: %H:%M'); if ( $stopover->arrival_delay ) { - $arr_line .= sprintf( ' (%+d)', $stopover->arrival_delay ); + $arr_line + .= sprintf( ' (%+d)', $stopover->arrival_delay ); } push( @stop_lines, $arr_line ); } if ( $stopover->departure ) { - my $dep_line = $stopover->departure->strftime('Abfahrt: %H:%M'); + my $dep_line + = $stopover->departure->strftime('Abfahrt: %H:%M'); if ( $stopover->departure_delay ) { - $dep_line .= sprintf( ' (%+d)', $stopover->departure_delay ); + $dep_line + .= sprintf( ' (%+d)', $stopover->departure_delay ); } push( @stop_lines, $dep_line ); } @@ -997,12 +1004,15 @@ sub ajax_route_efa { my $trip_id = $self->stash('tripid'); my $stopseq; - if ( $trip_id =~ m{ ^ ([^@]*) @ ([^@]*) [(] ([^)]*) [)] (.*) $ }x ) { + if ( $trip_id + =~ m{ ^ ([^@]*) @ ([^@]*) [(] ([^T]*) T ([^)]*) [)] (.*) $ }x ) + { $stopseq = { stateless => $1, stop_id => $2, date => $3, - key => $4 + time => $4, + key => $5 }; } else { diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 352047f..a169e27 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -1517,12 +1517,15 @@ sub train_details_efa { my $trip_id = $self->stash('train'); my $stopseq; - if ( $trip_id =~ m{ ^ ([^@]*) @ ([^@]*) [(] ([^)]*) [)] (.*) $ }x ) { + if ( $trip_id + =~ m{ ^ ([^@]*) @ ([^@]*) [(] ([^T]*) T ([^)]*) [)] (.*) $ }x ) + { $stopseq = { stateless => $1, stop_id => $2, date => $3, - key => $4 + time => $4, + key => $5 }; } else { @@ -2165,17 +2168,11 @@ sub render_board_efa { departure => $result->rt_datetime ? $result->rt_datetime->strftime('%H:%M') : undef, - train => $result->line, - train_type => q{}, - train_line => $result->line, - train_no => $result->train_no, - journey_id => sprintf( '%s@%d(%s)%d', - $result->stateless =~ s{ }{}gr, - scalar $result->route_pre - ? ( $result->route_pre )[0]->id_num - : $result->stop_id_num, - $result->sched_datetime->strftime('%Y%m%d'), - $result->key ), + train => $result->line, + train_type => q{}, + train_line => $result->line, + train_no => $result->train_no, + journey_id => $result->id, via => [ map { $_->name } $result->route_interesting ], origin => $result->origin, destination => $result->destination, |