summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDerf Null <derf@finalrewind.org>2023-05-01 11:38:11 +0200
committerDerf Null <derf@finalrewind.org>2023-05-01 11:38:11 +0200
commitaf3cdee11397ccff1b2b1fe1e693031e3b60ed93 (patch)
tree1e227e868df35326b6faa7dd6f9fbdaf852cb456 /lib
parentd18d068894289caa8301b05c896c3a49d30fac8a (diff)
route: only override delay if real-time data is not available
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index be17d71..ca80352 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -1023,8 +1023,13 @@ sub startup {
$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};
+ if ( not $station->[2]{rt_arr} ) {
+ $station->[2]{rt_arr} = $old{rt_arr};
+ $station->[2]{arr_delay} = $old{arr_delay};
+ }
+ if ( not $station->[2]{rt_dep} ) {
+ $station->[2]{rt_dep} = $old{rt_dep};
+ $station->[2]{dep_delay} = $old{dep_delay};
}
}
}