summaryrefslogtreecommitdiff
path: root/bin/db-zugbildung-to-json
diff options
context:
space:
mode:
Diffstat (limited to 'bin/db-zugbildung-to-json')
-rwxr-xr-xbin/db-zugbildung-to-json7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/db-zugbildung-to-json b/bin/db-zugbildung-to-json
index f5439d1..849d685 100755
--- a/bin/db-zugbildung-to-json
+++ b/bin/db-zugbildung-to-json
@@ -574,7 +574,12 @@ for my $train_number ( keys %map ) {
for my $wagon ( @{ $wagon_map{$train_number} // [] } ) {
my ( $wagon_type, $wagon_number ) = @{$wagon};
- push( @{ $map{$train_number}{wagons} }, $wagon );
+ my $json_wagon = { type => $wagon_type };
+ if ($wagon_number) {
+ $json_wagon->{number} = 0 + $wagon_number;
+ }
+
+ push( @{ $map{$train_number}{wagons} }, $json_wagon );
if ( $wagon_type =~ m{ 40[1-9] | 14[67] }x ) {
next;