summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-06-24 18:02:45 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-06-24 18:02:45 +0200
commit36121ccffc8dc65b27bcfbe1299fb6a7f9a5f77c (patch)
tree67aaec51f26b3d34eb4810205ad452ad10cc99c1 /lib
parent6b9bf8e4861343dbc3f7a54436f5a6dcb2d08ec9 (diff)
show wagon order before departure1.8.0
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index afeb880..df1d970 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -2264,6 +2264,7 @@ sub startup {
for my $station (@route) {
if ( $in_transit->{arr_name}
+ and @route_after
and $station->[0] eq $in_transit->{arr_name} )
{
$stop_before_dest = $route_after[-1][0];
@@ -2353,6 +2354,25 @@ sub startup {
$ret->{departure_countdown}
= $ret->{real_departure}->epoch - $now->epoch;
+
+ if ( $ret->{departure_countdown} > 0
+ and $in_transit->{data}{wagonorder_dep} )
+ {
+ my $wr;
+ eval {
+ $wr
+ = Travel::Status::DE::DBWagenreihung->new(
+ from_json => $in_transit->{data}{wagonorder_dep} );
+ };
+ if ( $wr
+ and $wr->sections
+ and $wr->wagons
+ and defined $wr->direction )
+ {
+ $ret->{wagonorder} = $wr;
+ }
+ }
+
if ( $in_transit->{real_arr_ts} ) {
$ret->{arrival_countdown}
= $ret->{real_arrival}->epoch - $now->epoch;