summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDerf Null <derf@finalrewind.org>2023-04-30 07:42:48 +0200
committerDerf Null <derf@finalrewind.org>2023-04-30 07:42:48 +0200
commit796699a9c65d728f58924c62a862f0e94afa5507 (patch)
treedeb656ead18d64a29061e3cc2732c0b207c89c7a /lib
parent6bdbe82949ebd09aad2e2402cb7a14fee8e68148 (diff)
add_route_timestamps: keep real-time data where possible
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 7350c76..be17d71 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -1016,7 +1016,16 @@ sub startup {
if ( $station->[2]{isCancelled} ) {
$sd->{isCancelled} = 1;
}
+
+ # keep rt_dep / rt_arr if they are no longer present
+ my %old;
+ for my $k (qw(rt_arr rt_dep arr_delay dep_delay)) {
+ $old{$k} = $station->[2]{$k};
+ }
$station->[2] = $sd;
+ for my $k (qw(rt_arr rt_dep arr_delay dep_delay)) {
+ $station->[2]{$k} ||= $old{$k};
+ }
}
}