Unverified Commit 75a7a706 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

journey: properly handle origin/destination and route_{start,end}

parent da949651
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -126,17 +126,20 @@ 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 ( $journey->{stbStop} ) {
		if ( $hafas->{arrivals} ) {
			$ref->{origin} = $ref->{route_end};
		}
		else {
			$ref->{destination} = $ref->{route_end};
		}
	}

	bless( $ref, $obj );