Aktualizacja filtrowania postojów

This commit is contained in:
2022-07-10 17:14:30 +02:00
parent b246f2d2d7
commit faed36c41c
+5 -4
View File
@@ -117,15 +117,16 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN
let prevStationName = '', let prevStationName = '',
nextStationName = ''; nextStationName = '';
for (let i = trainStopIndex - 1; i >= 0; i--) { for (let i = trainStopIndex - 1; i >= 0; i--) {
if (followingStops[i].stopName.startsWith('<strong>')) { if (/strong|podg/g.test(followingStops[i].stopName)) {
prevStationName = followingStops[i].stopNameRAW; prevStationName = followingStops[i].stopNameRAW;
break; break;
} }
} }
for (let i = trainStopIndex + 1; i < followingStops.length; i++) { for (let i = trainStopIndex + 1; i < followingStops.length; i++) {
if (followingStops[i].stopName.startsWith('<strong>')) { if (/strong|podg/g.test(followingStops[i].stopName)) {
nextStationName = followingStops[i].stopNameRAW; nextStationName = followingStops[i].stopNameRAW;
break; break;
} }
@@ -139,7 +140,7 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN
if (currentStop.departureLine == null) break; if (currentStop.departureLine == null) break;
if (!/-|_|it|sbl/gi.test(currentStop.departureLine)) { if (!/_|it|sbl/gi.test(currentStop.departureLine)) {
departureLine = currentStop.departureLine; departureLine = currentStop.departureLine;
break; break;
} }
@@ -150,7 +151,7 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN
if (currentStop.arrivalLine == null) break; if (currentStop.arrivalLine == null) break;
if (!/-|_|it|sbl/gi.test(currentStop.arrivalLine)) { if (!/_|it|sbl/gi.test(currentStop.arrivalLine)) {
arrivingLine = currentStop.arrivalLine; arrivingLine = currentStop.arrivalLine;
break; break;
} }