From b7ec9a5b0fb8bc3d1ce54d580b355a1542c9ef78 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Sun, 26 Nov 2023 12:40:56 +0000 Subject: [PATCH] fix: don't announce trains as delayed when they've departed --- src/announcement-data/systems/stations/AmeyPhil.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/announcement-data/systems/stations/AmeyPhil.tsx b/src/announcement-data/systems/stations/AmeyPhil.tsx index 2b9bad762..407208ce2 100644 --- a/src/announcement-data/systems/stations/AmeyPhil.tsx +++ b/src/announcement-data/systems/stations/AmeyPhil.tsx @@ -4972,6 +4972,11 @@ function LiveTrainAnnouncements({ nextTrainHandler, disruptedTrainHandler, syste console.log(`[Live Trains] Skipping ${s.rid} (${s.std} to ${s.destination[0].locationName}) as it was announced recently`) return false } + if (s.atdSpecified) { + addLog(`Skipping ${s.trainid} ${s.rid} (${std} to ${s.destination[0].locationName}) as it has already departed`) + console.log(`[Live Trains] Skipping ${s.rid} (${std} to ${s.destination[0].locationName}) as it has already departed`) + return false + } if (!s.isCancelled && calculateDelayMins(new Date(s.std), new Date(s.etd)) < 5 && s.etdSpecified && s.stdSpecified) { addLog(`Skipping ${s.trainid} ${s.rid} (${s.std} to ${s.destination[0].locationName}) as it is not delayed`) console.log(`[Live Trains] Skipping ${s.rid} (${s.std} to ${s.destination[0].locationName}) as it is not delayed`)