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

Location: Parse cancellations

parent 5720802d
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -50,6 +50,22 @@ sub new {
		  = $opt{strptime_obj}->parse_datetime( $json->{ezAnkunftsZeitpunkt} );
	}

	for my $message ( @{ $json->{priorisierteMeldungen} // [] } ) {
		if ( $message->{type} and $message->{type} eq 'HALT_AUSFALL' ) {
			$ref->{is_cancelled} = 1;
		}
		push( @{ $ref->{messages} }, $message );
	}

	for my $message ( @{ $json->{risMeldungen} // [] } ) {
		if (    $message->{key}
			and $message->{key} eq 'text.realtime.stop.cancelled' )
		{
			$ref->{is_cancelled} = 1;
		}
		$ref->{ris_messages}{ $message->{key} } = $message->{value};
	}

	$ref->{arr}      = $ref->{rt_arr}      // $ref->{sched_arr};
	$ref->{dep}      = $ref->{rt_dep}      // $ref->{sched_dep};
	$ref->{platform} = $ref->{rt_platform} // $ref->{sched_platform};