From 7b245833632b10ef08848833fc6c2934682f0c19 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 12 Apr 2024 19:41:18 +0200 Subject: partially work around Travel::Status::DE::HAFAS mis-detecting ÖBB station names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/DBInfoscreen/Controller/Stationboard.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index e9b95b8..896554d 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -518,7 +518,14 @@ sub handle_request { ( $status->station ? $status->station->{name} : $station ), }; - if ( $status->station and $status->station->{names} ) { + # Travel::Status::DE::HAFAS mis-detects ÖBB station names + if ( $hafas + and $hafas eq 'ÖBB' + and @{ $status->station->{names} // [] } > 1 ) + { + $data->{station_name} = $station; + } + elsif ( $status->station and $status->station->{names} ) { $data->{station_name} = List::Util::reduce { length($a) < length($b) ? $a : $b } @{ $status->station->{names} }; -- cgit v1.2.3