From ed1ae5cdbfe0e47a2bd2f7d4251b82a550afe9e1 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 27 Mar 2024 12:39:45 +0100 Subject: $product->name: Handle ÖBB "Zug-Nr." in-band annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Travel/Status/DE/HAFAS/Product.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/Travel/Status') diff --git a/lib/Travel/Status/DE/HAFAS/Product.pm b/lib/Travel/Status/DE/HAFAS/Product.pm index 14cc018..42b264b 100644 --- a/lib/Travel/Status/DE/HAFAS/Product.pm +++ b/lib/Travel/Status/DE/HAFAS/Product.pm @@ -32,12 +32,20 @@ sub new { my $train_no = $product->{prodCtx}{num}; my $cat = $product->{prodCtx}{catOut}; my $catlong = $product->{prodCtx}{catOutL}; + + # ÖBB, you so silly + if ( $name and $name =~ m{Zug-Nr} and $product->{nameS} ) { + $name = $product->{nameS}; + } + if ( $name and $cat and $name eq $cat and $product->{nameS} ) { $name .= ' ' . $product->{nameS}; } + if ( defined $train_no and not $train_no ) { $train_no = undef; } + if ( not defined $line_no and defined $product->{prodCtx}{matchId} -- cgit v1.2.3