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

station name: remove ÖBB workaround (fixed in HAFAS 6.02)

parent 80ba6df8
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -518,19 +518,6 @@ sub handle_request {
				  ( $status->station ? $status->station->{name} : $station ),
			};

			# Travel::Status::DE::HAFAS mis-detects ÖBB station names
			if (    $hafas
				and $hafas eq 'ÖBB'
				and @{ $status->station->{names} // [] } > 1 )
			{
				$data->{station_name} = $station;
			}
			elsif ( $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;