summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/HAFAS/Product.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-03-27 12:39:45 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-03-27 12:39:45 +0100
commited1ae5cdbfe0e47a2bd2f7d4251b82a550afe9e1 (patch)
treea705d4da5a10a35fe8516f6acc2ab9ed5076a639 /lib/Travel/Status/DE/HAFAS/Product.pm
parent830badd9e7413fc7fd4dc70e2e0219fa4642c954 (diff)
$product->name: Handle ÖBB "Zug-Nr." in-band annotations
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS/Product.pm')
-rw-r--r--lib/Travel/Status/DE/HAFAS/Product.pm8
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}