Skip to content

Commit 7a4c0ea

Browse files
committed
filter out some misclassified services in local-only mode
previously these services were shown erroneously: * FlixTrain * EuroNight (EN) services * European Sleeper
1 parent 9cbf5f2 commit 7a4c0ea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/reachableFrom.js

+5
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,17 @@ const reachableForDay = async (date, stationId, localTrainsOnly) => {
6464
const reachable = l.flatMap(trainDepartures, departure => {
6565
// todo: make this less brittle
6666
if (localTrainsOnly) {
67+
// EuroNight (EN) services are sometimes misclassified as regional trains
68+
// so we filter them out manually.
69+
if (departure.line.name.startsWith("EN")) return []
6770
// since some privately operated trains are wrongly categorized as
6871
// regional transit, we filter them out manually. this list is
6972
// probably incomplete.
73+
if (departure.line.operator?.name === 'European Sleeper') return []
7074
if (departure.line.operator?.name === 'FlixTrain') return []
7175
if (departure.line.operator?.name === 'Snälltåget') return []
7276
if (departure.line.operator?.name === 'Urlaubs-Express') return []
77+
if (departure.line.operator?.name === 'WESTbahn') return []
7378
}
7479

7580
const { when, nextStopovers = [] } = departure

0 commit comments

Comments
 (0)