Commit 8c4df880 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

allow filtering by train for external travelynx links

parent 98fc5a3a
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1236,6 +1236,7 @@ post '/logout' => sub {
get '/s/*station' => sub {
	my ($self)  = @_;
	my $station = $self->stash('station');
	my $train   = $self->param('train');

	my $status = get_departures($station);

@@ -1251,6 +1252,11 @@ get '/s/*station' => sub {
		  map { [ $_, $_->departure->epoch // $_->sched_departure->epoch ] }
		  @results;

		if ($train) {
			@results
			  = grep { $_->type . ' ' . $_->train_no eq $train } @results;
		}

		$self->render(
			'departures',
			ds100   => $status->{station_ds100},