diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-04-13 19:05:13 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-04-13 19:05:13 +0200 |
commit | 83fdae2c47289d837832286d4684fdd5b493b6c8 (patch) | |
tree | c9bd36cf878a4b8f624e3ed0ac549830069970a5 /lib/DBInfoscreen | |
parent | 975314953acc5780760c5247f3d9c15d49d0c692 (diff) |
train details: always get details from HAFAS Journey object4.25.2
Diffstat (limited to 'lib/DBInfoscreen')
-rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 54390d6..9657bc0 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -1170,20 +1170,26 @@ sub train_details { $res->{trip_id} = $journey->id; $res->{date} = $route->[0]{sched_dep} // $route->[0]{dep}; - if ( not $res->{train_type} ) { - my $train_type = $res->{train_type} = $journey->type // q{}; - my $train_no = $res->{train_no} = $journey->number // q{}; - $res->{train_line} = $journey->line_no // q{}; - $self->stash( title => $train_type . ' ' - . ( $train_no || $res->{train_line} ) ); + my $product = $journey->product; + + if ( my $req_name = $self->param('highlight') ) { + if ( my $p = $journey->product_at($req_name) ) { + $product = $p; + } } - if ( not defined $journey->class ) { + my $train_type = $res->{train_type} = $product->type // q{}; + my $train_no = $res->{train_no} = $product->number // q{}; + $res->{train_line} = $product->line_no // q{}; + $self->stash( title => $train_type . ' ' + . ( $train_no || $res->{train_line} ) ); + + if ( not defined $product->class ) { $linetype = 'ext'; } else { my $prod - = $self->class_to_product($hafas_obj)->{ $journey->class } + = $self->class_to_product($hafas_obj)->{ $product->class } // q{}; if ( $prod eq 'ice' or $prod eq 'ic_ec' ) { $linetype = 'fern'; |