Unverified Commit 15fa71db authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

train details: support non-DB HAFAS backends

parent 3a568e5d
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1102,6 +1102,7 @@ sub station_train_details {
sub train_details {
	my ($self) = @_;
	my $train  = $self->stash('train');
	my $hafas  = $self->param('hafas');

	# TODO error handling

@@ -1139,6 +1140,11 @@ sub train_details {
		$opt{train_no}   = $train_no;
	}

	my $service = 'DB';
	if ( $hafas ne '1' and Travel::Status::DE::HAFAS::get_service($hafas) ) {
		$opt{service} = $hafas;
	}

	if ( $self->languages =~ m{^en} ) {
		$opt{language} = 'en';
	}
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ sub get_route_p {

	if ( $opt{trip_id} ) {
		$hafas_promise = Travel::Status::DE::HAFAS->new_p(
			service => $opt{service},
			journey => {
				id => $opt{trip_id},
			},