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

HAFAS->get_route_p: handle DB Liniennummerharmonisierung at ÖBB

This only affects the augmentation of IRIS requests with ÖBB HAFAS data
parent 0ca91354
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -68,10 +68,22 @@ sub get_route_p {
			promise    => 'Mojo::Promise',
			user_agent => $agent->request_timeout(10)
		);
		$self->{log}->debug("HAFAS->get_route_p(trip_id => $opt{trip_id})");
	}
	elsif ( $opt{train} ) {
		if ( grep { $_ eq 'S' } $opt{train}->classes ) {
			$opt{train_req} = 'DB ' . $opt{train}->train_no;
		}
		elsif ( grep { $_ eq 'N' } $opt{train}->classes
			or not scalar $opt{train}->classes )
		{
			$opt{train_req} = $opt{train}->train_no;
		}
		else {
			$opt{train_req} = $opt{train}->type . ' ' . $opt{train}->train_no;
		}
		$opt{train_origin} = $opt{train}->origin;
		$self->{log}->debug("HAFAS->get_route_p(train => $opt{train_req})");
	}
	else {
		$opt{train_req} = $opt{train_type} . ' ' . $opt{train_no};