diff options
-rw-r--r-- | Changelog | 6 | ||||
-rwxr-xr-x | bin/dbris-m | 12 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DBRIS.pm | 4 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/Formation.pm | 2 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm | 2 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/Formation/Group.pm | 5 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/Formation/Sector.pm | 2 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/Journey.pm | 4 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm | 2 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/Location.pm | 5 |
10 files changed, 30 insertions, 14 deletions
@@ -1,3 +1,9 @@ +Travel::Status::DE::DBRIS 0.14 - Fri Sep 19 2025 + + * dbris-m: Do not break --(raw-)json if the requested stop name is not an + exact match + * Location: Set is_additional for additional stops based on text remarks + Travel::Status::DE::DBRIS 0.13 - Mon Aug 25 2025 * Formation::Group: Update carriage name list (patch by Lili Chelsea Urban) diff --git a/bin/dbris-m b/bin/dbris-m index dc3aedc..ad590b7 100755 --- a/bin/dbris-m +++ b/bin/dbris-m @@ -3,7 +3,7 @@ use strict; use warnings; use 5.020; -our $VERSION = '0.13'; +our $VERSION = '0.14'; use utf8; use DateTime; @@ -126,7 +126,9 @@ else { my $found; for my $result ( $status->results ) { if ( defined $result->eva ) { - if ( lc( $result->name ) ne lc( $opt{station} ) ) { + if ( lc( $result->name ) ne lc( $opt{station} ) + and not( $json_output or $raw_json_output ) ) + { say $result->name; } $opt{station} = $result; @@ -388,7 +390,9 @@ elsif ( $opt{journey} and not( $raw_json_output or $json_output ) ) { } printf( "%s %s am %s\n\n", - $trip->type, $trip->train_no, $trip->day->strftime('%d.%m.%Y') ); + $trip->type, + $trip->train_no // $trip->number, + $trip->day->strftime('%d.%m.%Y') ); for my $stop ( $trip->route ) { if ( $stop == $mark_stop ) { @@ -603,7 +607,7 @@ B<dbris-m> B<?>I<query>|I<lat>B<:>I<lon> =head1 VERSION -version 0.13 +version 0.14 =head1 DESCRIPTION diff --git a/lib/Travel/Status/DE/DBRIS.pm b/lib/Travel/Status/DE/DBRIS.pm index ff37fd2..1826cdc 100644 --- a/lib/Travel/Status/DE/DBRIS.pm +++ b/lib/Travel/Status/DE/DBRIS.pm @@ -19,7 +19,7 @@ use Travel::Status::DE::DBRIS::JourneyAtStop; use Travel::Status::DE::DBRIS::Journey; use Travel::Status::DE::DBRIS::Location; -our $VERSION = '0.13'; +our $VERSION = '0.14'; # {{{ Constructors @@ -427,7 +427,7 @@ Non-blocking variant; =head1 VERSION -version 0.13 +version 0.14 =head1 DESCRIPTION diff --git a/lib/Travel/Status/DE/DBRIS/Formation.pm b/lib/Travel/Status/DE/DBRIS/Formation.pm index 309656d..dbde764 100644 --- a/lib/Travel/Status/DE/DBRIS/Formation.pm +++ b/lib/Travel/Status/DE/DBRIS/Formation.pm @@ -12,7 +12,7 @@ use Travel::Status::DE::DBRIS::Formation::Group; use Travel::Status::DE::DBRIS::Formation::Sector; use Travel::Status::DE::DBRIS::Formation::Carriage; -our $VERSION = '0.13'; +our $VERSION = '0.14'; Travel::Status::DE::DBRIS::Formation->mk_ro_accessors( qw(direction platform train_type)); diff --git a/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm b/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm index c99d706..4e9590b 100644 --- a/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm +++ b/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm @@ -8,7 +8,7 @@ use utf8; use parent 'Class::Accessor'; use Carp qw(cluck); -our $VERSION = '0.13'; +our $VERSION = '0.14'; Travel::Status::DE::DBRIS::Formation::Carriage->mk_ro_accessors( qw(class_type is_closed is_dosto is_locomotive is_powercar number model section uic_id type diff --git a/lib/Travel/Status/DE/DBRIS/Formation/Group.pm b/lib/Travel/Status/DE/DBRIS/Formation/Group.pm index 47178a1..4ddbb3a 100644 --- a/lib/Travel/Status/DE/DBRIS/Formation/Group.pm +++ b/lib/Travel/Status/DE/DBRIS/Formation/Group.pm @@ -8,7 +8,7 @@ use utf8; use parent 'Class::Accessor'; use List::Util qw(uniq); -our $VERSION = '0.13'; +our $VERSION = '0.14'; Travel::Status::DE::DBRIS::Formation::Group->mk_ro_accessors( qw(designation name train_no train_type description desc_short destination has_sectors model series start_percent end_percent) @@ -424,6 +424,9 @@ sub parse_powertype { sub parse_model { my ($self) = @_; + # TODO also consider power type (91/94) and country, + # see https://github.com/derf/travelynx/issues/294 + my %ml = ( '011' => 0, '023' => 0, diff --git a/lib/Travel/Status/DE/DBRIS/Formation/Sector.pm b/lib/Travel/Status/DE/DBRIS/Formation/Sector.pm index a3247bb..51e5b35 100644 --- a/lib/Travel/Status/DE/DBRIS/Formation/Sector.pm +++ b/lib/Travel/Status/DE/DBRIS/Formation/Sector.pm @@ -7,7 +7,7 @@ use utf8; use parent 'Class::Accessor'; -our $VERSION = '0.13'; +our $VERSION = '0.14'; Travel::Status::DE::DBRIS::Formation::Sector->mk_ro_accessors( qw(name start_percent end_percent length_percent start_meters end_meters length_meters cube_meters cube_percent) diff --git a/lib/Travel/Status/DE/DBRIS/Journey.pm b/lib/Travel/Status/DE/DBRIS/Journey.pm index 29e8b6d..6dad9ba 100644 --- a/lib/Travel/Status/DE/DBRIS/Journey.pm +++ b/lib/Travel/Status/DE/DBRIS/Journey.pm @@ -8,7 +8,7 @@ use parent 'Class::Accessor'; use Travel::Status::DE::DBRIS::Location; -our $VERSION = '0.13'; +our $VERSION = '0.14'; # ->number is deprecated # TODO: Rename ->train, ->train_no to ->trip, ->trip_no @@ -201,7 +201,7 @@ journey received by Travel::Status::DE::DBRIS =head1 VERSION -version 0.13 +version 0.14 =head1 DESCRIPTION diff --git a/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm b/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm index 8ebd463..992e45e 100644 --- a/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm +++ b/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm @@ -6,7 +6,7 @@ use 5.020; use parent 'Class::Accessor'; -our $VERSION = '0.13'; +our $VERSION = '0.14'; Travel::Status::DE::DBRIS::JourneyAtStop->mk_ro_accessors( qw(type dep sched_dep rt_dep delay is_cancelled line stop_eva id platform rt_platform destination via_last diff --git a/lib/Travel/Status/DE/DBRIS/Location.pm b/lib/Travel/Status/DE/DBRIS/Location.pm index 580291f..e607ce1 100644 --- a/lib/Travel/Status/DE/DBRIS/Location.pm +++ b/lib/Travel/Status/DE/DBRIS/Location.pm @@ -6,7 +6,7 @@ use 5.020; use parent 'Class::Accessor'; -our $VERSION = '0.13'; +our $VERSION = '0.14'; Travel::Status::DE::DBRIS::Location->mk_ro_accessors( qw(eva id lat lon name products type is_cancelled is_additional is_separation display_priority @@ -97,6 +97,9 @@ sub new { if ( $message->{type} and $message->{type} eq 'HALT_AUSFALL' ) { $ref->{is_cancelled} = 1; } + elsif ( $message->{text} and $message->{text} eq 'Zusatzhalt' ) { + $ref->{is_additional} = 1; + } push( @{ $ref->{messages} }, $message ); } |