summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornetworkException <git@nwex.de>2025-06-09 23:29:58 +0200
committerBirte Friesel <derf@chaosdorf.de>2025-06-17 18:02:09 +0200
commit866866965ac959e0cf358c1849251ffe47651485 (patch)
tree37b56399e83c205bdfbdae0aa03ed96bc468b82b
parentd7a9946aa12807da1a2a1c1dd7f31de94f1691bc (diff)
motis-m: Fix --json for trip lookup
-rwxr-xr-xbin/motis-m2
-rw-r--r--lib/Travel/Status/MOTIS/Trip.pm4
2 files changed, 3 insertions, 3 deletions
diff --git a/bin/motis-m b/bin/motis-m
index 15b9bc7..036d880 100755
--- a/bin/motis-m
+++ b/bin/motis-m
@@ -270,7 +270,7 @@ if ($raw_json_output) {
}
if ($json_output) {
- if ( $opt{journey} ) {
+ if ( $opt{trip_id} ) {
say JSON->new->convert_blessed->encode( $status->result );
}
else {
diff --git a/lib/Travel/Status/MOTIS/Trip.pm b/lib/Travel/Status/MOTIS/Trip.pm
index 161b4f7..f9e14b4 100644
--- a/lib/Travel/Status/MOTIS/Trip.pm
+++ b/lib/Travel/Status/MOTIS/Trip.pm
@@ -165,8 +165,8 @@ sub stopovers {
sub TO_JSON {
my ($self) = @_;
- # transform raw_route into route (lazy accessor)
- $self->route;
+ # transform raw_stopovers into stopovers (lazy accessor)
+ $self->stopovers;
# transform raw_polyline into polyline (lazy accessor)
$self->polyline;