summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel')
-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} };
+ }
}
}