summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-04-12 19:41:18 +0200
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-04-12 19:41:18 +0200
commit7b245833632b10ef08848833fc6c2934682f0c19 (patch)
treeb1474ecfa24448c1dc1ffee45d972d90aa81aff8
parenta62ab624d4a5031e82777bdb3b45e99fd177d7b1 (diff)
partially work around Travel::Status::DE::HAFAS mis-detecting ÖBB station names4.25.1
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm9
1 files changed, 8 insertions, 1 deletions
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} };