From 516b88941c6c065e8773dc6091d29025d8d0b330 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 30 Oct 2021 09:29:41 +0200 Subject: HAFAS: Hide unhelpful messages --- lib/DBInfoscreen/Helper/HAFAS.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib') diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm index 91661a2..31615b1 100644 --- a/lib/DBInfoscreen/Helper/HAFAS.pm +++ b/lib/DBInfoscreen/Helper/HAFAS.pm @@ -186,6 +186,16 @@ sub get_xml_p { my $header = $message->getAttribute('header'); my $lead = $message->getAttribute('lead'); my $display = $message->getAttribute('display'); + + # "something is wrong, but we're not telling what" is not helpful. + # Observed on RRX lines in NRW + if ( $header + =~ m{ : \s St..?rung. \s \(Quelle: \s zuginfo.nrw \) $ }x + and not $lead ) + { + next; + } + push( @{ $ret->{messages} }, { -- cgit v1.2.3