fix filtrowania RJ na posterunkach; favicons index

This commit is contained in:
2023-11-12 15:47:55 +01:00
parent 7b4da9d422
commit 8705dd1df5
3 changed files with 34 additions and 19 deletions
+8 -8
View File
@@ -188,7 +188,7 @@ export function getScheduledTrains(
sceneryData: API.ActiveSceneries.Data,
stationGeneralInfo: Station['generalInfo']
): ScheduledTrain[] {
const stationName = sceneryData.stationName.toLocaleLowerCase();
const stationNameLower = sceneryData.stationName.toLocaleLowerCase();
stationGeneralInfo?.checkpoints.forEach((cp) => (cp.scheduledTrains.length = 0));
@@ -199,14 +199,14 @@ export function getScheduledTrains(
if (!timetable.sceneries.includes(sceneryData.stationHash)) return acc;
const stopInfoIndex = timetable.followingStops.findIndex((stop) => {
const stopName = stop.stopNameRAW.toLowerCase();
const stopNameLower = stop.stopNameRAW.toLocaleLowerCase();
return (
stationName == stopName ||
(!/(po\.|podg\.)/.test(stopName) && stopName.includes(stationName)) ||
(!/(po\.|podg\.)/.test(stationName) && stationName.includes(stopName)) ||
(stopName.split(', podg.')[0] !== undefined &&
stationName.startsWith(stopName.split(', podg.')[0]))
stationNameLower == stopNameLower ||
(!/(po\.|podg\.)/.test(stopNameLower) && stopNameLower.includes(stationNameLower)) ||
(!/(po\.|podg\.)/.test(stationNameLower) && stationNameLower.includes(stopNameLower)) ||
(stopNameLower.split(', podg.')[0] !== undefined &&
stationNameLower.startsWith(stopNameLower.split(', podg.')[0]))
);
});
@@ -219,7 +219,7 @@ export function getScheduledTrains(
}
stationGeneralInfo?.checkpoints?.forEach((checkpoint) => {
if (checkpoint.checkpointName.toLocaleLowerCase() == stationName) return;
// if (checkpoint.checkpointName.toLocaleLowerCase() == stationNameLower) return;
if (
checkpointScheduledTrains.findIndex(