summaryrefslogtreecommitdiff
path: root/lib/Travel/Status
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-04-12 19:58:49 +0200
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-04-12 19:58:49 +0200
commit65a90c602cfa4baa195b3a18c529559f81c29c38 (patch)
treeace9376ce648f92f8c018fbcd88ac42319ae7c66 /lib/Travel/Status
parent757cf4d3e34f62a2f18e695ff6bd46c818c15298 (diff)
HAFAS->station: ÖBB needs special handling
Diffstat (limited to 'lib/Travel/Status')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm
index a20d157..2cf642a 100644
--- a/lib/Travel/Status/DE/HAFAS.pm
+++ b/lib/Travel/Status/DE/HAFAS.pm
@@ -1104,10 +1104,19 @@ sub station {
my %prefc_by_loc;
- for my $i ( 0 .. $#locL ) {
- my $loc = $locL[$i];
- if ( $loc->{pRefL} ) {
- $prefc_by_loc{$i} = $#{ $loc->{pRefL} };
+ if ( $self->{active_service} and $self->{active_service} eq 'ÖBB' ) {
+ for my $jny ( @{ $self->{raw_json}{svcResL}[0]{res}{jnyL} // [] } ) {
+ if ( defined $jny->{stbStop}{locX} ) {
+ $prefc_by_loc{ $jny->{stbStop}{locX} } += 1;
+ }
+ }
+ }
+ else {
+ for my $i ( 0 .. $#locL ) {
+ my $loc = $locL[$i];
+ if ( $loc->{pRefL} ) {
+ $prefc_by_loc{$i} = $#{ $loc->{pRefL} };
+ }
}
}