Skip to content

Commit

Permalink
Merge pull request #60 from davwheat/main
Browse files Browse the repository at this point in the history
fix: don't announce trains as delayed when they've departed
  • Loading branch information
davwheat authored Nov 26, 2023
2 parents 8accbf2 + b7ec9a5 commit 6b7df59
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/announcement-data/systems/stations/AmeyPhil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down

0 comments on commit 6b7df59

Please sign in to comment.