summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/DBRIS
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-12-26 13:46:17 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-12-26 13:46:17 +0100
commit611e5af908c48b2134c29b36dbd59b9e0940748d (patch)
treee1c827b02e722618068840baac1097526add6f45 /lib/Travel/Status/DE/DBRIS
parent5720802d4d827b071c8db0c54cbf94f7886f715d (diff)
Location: Parse cancellations
Diffstat (limited to 'lib/Travel/Status/DE/DBRIS')
-rw-r--r--lib/Travel/Status/DE/DBRIS/Location.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/DBRIS/Location.pm b/lib/Travel/Status/DE/DBRIS/Location.pm
index 63b26ac..c397b60 100644
--- a/lib/Travel/Status/DE/DBRIS/Location.pm
+++ b/lib/Travel/Status/DE/DBRIS/Location.pm
@@ -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};