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

hafas backend: show shortest station name in title

parent b1397229
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -472,6 +472,12 @@ sub handle_request {
				  ( $status->station ? $status->station->{name} : $station ),
			};

			if ( $status->station and $status->station->{names} ) {
				$data->{station_name}
				  = List::Util::reduce { length($a) < length($b) ? $a : $b }
				@{ $status->station->{names} };
			}

			if ( not @{ $data->{results} } and $template eq 'json' ) {
				$self->handle_no_results_json( $station, $data, $api_version );
				return;