From f9d1ea47ff7a444f4468aa4fbfade1120d500066 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 21 Dec 2020 19:11:52 +0100 Subject: keep detailed mode when following links; show train attributes in detailed mode --- lib/DBInfoscreen.pm | 7 ++++--- lib/DBInfoscreen/Controller/Stationboard.pm | 5 +++-- lib/DBInfoscreen/Controller/Wagenreihung.pm | 7 ++++--- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index aea71a9..54078ea 100644 --- a/lib/DBInfoscreen.pm +++ b/lib/DBInfoscreen.pm @@ -106,9 +106,10 @@ sub startup { my $ret; while ( my ( $k, $v ) = each %{ $ice_type_map->{train} } ) { if ( $v->{type} ) { - $ret->{$k} - = [ $v->{type}, $v->{short}, - exists $v->{wagons} ? 1 : 0 ]; + $ret->{$k} = [ + $v->{type}, $v->{shortType}, + exists $v->{wagons} ? 1 : 0 + ]; } } return $ret; diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index b168b6b..0367655 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -677,7 +677,8 @@ sub render_train { $self->app->train_details_db->{ $departure->{train_no} }, dt_now => DateTime->now( time_zone => 'Europe/Berlin' ), station_name => $station_name, - nav_link => '/' . $station_name, + nav_link => + $self->url_with( 'station', station => $station_name ), ); } )->wait; @@ -1236,7 +1237,7 @@ sub handle_result { or $template eq 'multi' ), force_mobile => ( $template eq 'app' ), - nav_link => '/' . $station_name, + nav_link => $self->url_with( 'station', station => $station_name ), ); } return; diff --git a/lib/DBInfoscreen/Controller/Wagenreihung.pm b/lib/DBInfoscreen/Controller/Wagenreihung.pm index 36f486b..4707d03 100644 --- a/lib/DBInfoscreen/Controller/Wagenreihung.pm +++ b/lib/DBInfoscreen/Controller/Wagenreihung.pm @@ -27,8 +27,9 @@ sub zugbildung_db { my @wagons; for my $wagon ( @{ $details->{wagons} } ) { - my ( $wagon_type, $wagon_number ) = @{$wagon}; - my %wagon = ( + my $wagon_type = $wagon->{type}; + my $wagon_number = $wagon->{number}; + my %wagon = ( fahrzeugnummer => "", fahrzeugtyp => $wagon_type, kategorie => $wagon_type =~ m{^[0-9.]+$} ? 'LOK' : '', @@ -56,7 +57,7 @@ sub zugbildung_db { $pos += 5; } - my $train_type = $details->{raw}; + my $train_type = $details->{rawType}; $train_type =~ s{ - .* }{}x; my $route_start = $details->{route}{start} // $details->{route}{preStart}; -- cgit v1.2.3