From af3cdee11397ccff1b2b1fe1e693031e3b60ed93 Mon Sep 17 00:00:00 2001 From: Derf Null Date: Mon, 1 May 2023 11:38:11 +0200 Subject: route: only override delay if real-time data is not available --- lib/Travelynx.pm | 9 +++++++-- 1 file 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}; } } } -- cgit v1.2.3