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

dbris-m: automatically run locationSearch when called with station name

parent 8f13385e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -75,6 +75,16 @@ elsif ( $opt{station} =~ m{[|]} ) {
	$opt{journey} = { id => $opt{station} };
	delete $opt{station};
}
elsif ( $opt{station} !~ m{ ^ \d+ $ }x ) {
	my $status
	  = Travel::Status::DE::DBRIS->new( locationSearch => $opt{station} );
	for my $result ( $status->results ) {
		if ( defined $result->eva ) {
			$opt{station} = $result->eva;
			last;
		}
	}
}

my $status = Travel::Status::DE::DBRIS->new(%opt);