Loading bin/dbris-m +4 −0 Original line number Diff line number Diff line Loading @@ -254,6 +254,8 @@ elsif ( $opt{journey} ) { my $max_name = max map { length( $_->name ) } $trip->route; my $max_platform = max map { length( $_->platform // q{} ) } $trip->route; my $max_delay = max map { $_->delay ? length( $_->delay ) + 3 : 0 } $trip->route; my $mark_stop = 0; my $now = DateTime->now( time_zone => 'Europe/Berlin' ); Loading Loading @@ -293,6 +295,8 @@ elsif ( $opt{journey} ) { else { print(' '); } printf( " %${max_delay}s", format_delay( $stop->delay, $max_delay - 3 ) ); printf( " %-${max_name}s %${max_platform}s\n", $stop->name, $stop->platform // q{} ); if ( $stop == $mark_stop ) { Loading lib/Travel/Status/DE/DBRIS/Location.pm +15 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ our $VERSION = '0.01'; Travel::Status::DE::DBRIS::Location->mk_ro_accessors( qw(eva id lat lon name products type is_cancelled is_additional is_separation display_priority dep arr platform sched_platform rt_platform dep arr arr_delay dep_delay delay platform sched_platform rt_platform ) ); Loading Loading @@ -50,6 +50,20 @@ sub new { = $opt{strptime_obj}->parse_datetime( $json->{ezAnkunftsZeitpunkt} ); } if ( $ref->{sched_dep} and $ref->{rt_dep} ) { $ref->{dep_delay} = $ref->{rt_dep}->subtract_datetime( $ref->{sched_dep} ) ->in_units('minutes'); } if ( $ref->{sched_arr} and $ref->{rt_arr} ) { $ref->{arr_delay} = $ref->{rt_arr}->subtract_datetime( $ref->{sched_arr} ) ->in_units('minutes'); } $ref->{delay} = $ref->{arr_delay} // $ref->{dep_delay}; for my $message ( @{ $json->{priorisierteMeldungen} // [] } ) { if ( $message->{type} and $message->{type} eq 'HALT_AUSFALL' ) { $ref->{is_cancelled} = 1; Loading Loading
bin/dbris-m +4 −0 Original line number Diff line number Diff line Loading @@ -254,6 +254,8 @@ elsif ( $opt{journey} ) { my $max_name = max map { length( $_->name ) } $trip->route; my $max_platform = max map { length( $_->platform // q{} ) } $trip->route; my $max_delay = max map { $_->delay ? length( $_->delay ) + 3 : 0 } $trip->route; my $mark_stop = 0; my $now = DateTime->now( time_zone => 'Europe/Berlin' ); Loading Loading @@ -293,6 +295,8 @@ elsif ( $opt{journey} ) { else { print(' '); } printf( " %${max_delay}s", format_delay( $stop->delay, $max_delay - 3 ) ); printf( " %-${max_name}s %${max_platform}s\n", $stop->name, $stop->platform // q{} ); if ( $stop == $mark_stop ) { Loading
lib/Travel/Status/DE/DBRIS/Location.pm +15 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ our $VERSION = '0.01'; Travel::Status::DE::DBRIS::Location->mk_ro_accessors( qw(eva id lat lon name products type is_cancelled is_additional is_separation display_priority dep arr platform sched_platform rt_platform dep arr arr_delay dep_delay delay platform sched_platform rt_platform ) ); Loading Loading @@ -50,6 +50,20 @@ sub new { = $opt{strptime_obj}->parse_datetime( $json->{ezAnkunftsZeitpunkt} ); } if ( $ref->{sched_dep} and $ref->{rt_dep} ) { $ref->{dep_delay} = $ref->{rt_dep}->subtract_datetime( $ref->{sched_dep} ) ->in_units('minutes'); } if ( $ref->{sched_arr} and $ref->{rt_arr} ) { $ref->{arr_delay} = $ref->{rt_arr}->subtract_datetime( $ref->{sched_arr} ) ->in_units('minutes'); } $ref->{delay} = $ref->{arr_delay} // $ref->{dep_delay}; for my $message ( @{ $json->{priorisierteMeldungen} // [] } ) { if ( $message->{type} and $message->{type} eq 'HALT_AUSFALL' ) { $ref->{is_cancelled} = 1; Loading