From 75411af57219a256a767361cb7c8caae1477ba9c Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 18 Apr 2025 13:04:35 +0200 Subject: Stationboard: dbris: show messages and attributes --- lib/DBInfoscreen/Controller/Stationboard.pm | 39 ++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'lib/DBInfoscreen/Controller/Stationboard.pm') diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index d05a5b1..662ef67 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -1305,17 +1305,54 @@ sub train_details_dbris { my ($dbris) = @_; my $trip = $dbris->result; + my ( @him_messages, @him_details ); + for my $message ( $trip->messages ) { + if ( not $message->{ueberschrift} ) { + push( + @him_messages, + [ + q{}, + { + icon => $message->{prioritaet} eq 'HOCH' + ? 'warning' + : 'info', + text => $message->{text} + } + ] + ); + } + } + + for my $attribute ( $trip->attributes ) { + push( + @him_details, + [ + q{}, + { + text => $attribute->{value} + . ( + $attribute->{teilstreckenHinweis} + ? q { } . $attribute->{teilstreckenHinweis} + : q{} + ) + } + ] + ); + } + my $now = DateTime->now( time_zone => 'Europe/Berlin' ); my $res = { trip_id => $trip_id, train_line => $trip->train, + train_no => $trip->number, origin => ( $trip->route )[0]->name, destination => ( $trip->route )[-1]->name, operators => [], linetype => 'bahn', route_pre_diff => [], route_post_diff => [], - moreinfo => [], + moreinfo => [@him_messages], + details => [@him_details], replaced_by => [], replacement_for => [], }; -- cgit v1.2.3