diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-03-27 12:39:45 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-03-27 12:39:45 +0100 |
commit | ed1ae5cdbfe0e47a2bd2f7d4251b82a550afe9e1 (patch) | |
tree | a705d4da5a10a35fe8516f6acc2ab9ed5076a639 /lib/Travel/Status/DE | |
parent | 830badd9e7413fc7fd4dc70e2e0219fa4642c954 (diff) |
$product->name: Handle ÖBB "Zug-Nr." in-band annotations
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r-- | lib/Travel/Status/DE/HAFAS/Product.pm | 8 |
1 files changed, 8 insertions, 0 deletions
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} |