From 2be390cbb3a94c622cf48618f791da1f78b248e0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 31 May 2021 20:41:06 +0200 Subject: fix trailing ":" after cancellation messages without reason --- lib/DBInfoscreen/Controller/Stationboard.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index ccd9be2..f7c469a 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -374,10 +374,16 @@ sub format_iris_result_info { = join( ', ', map { $_->[1] } $result->delay_messages ); my $qosmsg = join( ' +++ ', map { $_->[1] } $result->qos_messages ); if ( $result->is_cancelled ) { - $info = "Fahrt fällt aus: ${delaymsg}"; + $info = "Fahrt fällt aus"; + if ($delaymsg) { + $info .= ": ${delaymsg}"; + } } elsif ( $result->departure_is_cancelled ) { - $info = "Zug endet hier: ${delaymsg}"; + $info = "Zug endet hier"; + if ($delaymsg) { + $info .= ": ${delaymsg}"; + } } elsif ( $result->delay and $result->delay > 0 ) { if ( $template eq 'app' or $template eq 'infoscreen' ) { -- cgit v1.2.3