Commit fb639e55 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

trainsearch: handle unknown train types

IRIS reports unknown train types as "-"; HAFAS wants the train type to be
left out in this case
parent b06b69af
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -204,6 +204,10 @@ sub trainsearch_p {
		$opt{date_yyyy} = $now->strftime('%d.%m.%Y');
	}

	# IRIS reports trains with unknown type as type "-". HAFAS thinks otherwise
	# and prefers the type to be left out entirely in this case.
	$opt{train_req} =~ s{^- }{};

	my $promise = Mojo::Promise->new;

	$self->get_json_p( $self->{realtime_cache},