diff options
Diffstat (limited to 'lib/Travel')
-rw-r--r-- | lib/Travel/Status/DE/HAFAS/Journey.pm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Travel/Status/DE/HAFAS/Journey.pm b/lib/Travel/Status/DE/HAFAS/Journey.pm index 006edd9..8dafb82 100644 --- a/lib/Travel/Status/DE/HAFAS/Journey.pm +++ b/lib/Travel/Status/DE/HAFAS/Journey.pm @@ -126,16 +126,19 @@ sub new { is_cancelled => $is_cancelled, train => $train, operator => $operator, - route_end => $destination, + destination => $destination, + route_end => $stops[-1]{name}, messages => \@messages, route => \@stops, }; - if ( $hafas->{arrivals} ) { - $ref->{origin} = $ref->{route_end}; - } - else { - $ref->{destination} = $ref->{route_end}; + if ( $journey->{stbStop} ) { + if ( $hafas->{arrivals} ) { + $ref->{origin} = $ref->{route_end}; + } + else { + $ref->{destination} = $ref->{route_end}; + } } bless( $ref, $obj ); |