Skip to content

Commit 20ebd23

Browse files
Updated duplicate checking
1 parent f5db2c6 commit 20ebd23

6 files changed

Lines changed: 22416 additions & 12 deletions

File tree

.vscode/launch.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
"type": "node",
99
"request": "launch",
1010
"name": "Launch Program",
11-
"skipFiles": [
12-
"<node_internals>/**"
13-
],
14-
"program": "${workspaceFolder}/dist/app.js",
11+
"skipFiles": ["<node_internals>/**"],
12+
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/ts-node",
13+
"runtimeArgs": ["--transpile-only"],
14+
"program": "${workspaceFolder}/src/app.ts",
1515
"console": "integratedTerminal",
16-
"outFiles": [
17-
"${workspaceFolder}/dist/**/*.js"
18-
],
1916
"envFile": "${workspaceFolder}/.env"
2017
}
2118
]
22-
}
19+
}

package-lock.json

Lines changed: 168 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@types/luxon": "^3.4.2",
1313
"@types/node": "^20.11.5",
1414
"dotenv": "^16.4.0",
15+
"ts-node": "^10.9.2",
1516
"typescript": "^5.3.3"
1617
},
1718
"dependencies": {

src/app.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const untis = new WebUntis(
4545
const exams_events: IExam[] = parseExams(exams);
4646

4747
// Check for duplicate events
48-
timetable_events = checkDuplicateEvents(timetable_events, exams_events);
48+
// timetable_events = checkDuplicateEvents(timetable_events, exams_events);
4949

5050
// Create calendars
5151
const [timetable_calendar, exam_calendar] = [
@@ -99,7 +99,9 @@ function checkDuplicateEvents(
9999
return !exams_events.some((exam_event) => {
100100
return (
101101
timetable_event.startTime.getTime() ===
102-
exam_event.startTime.getTime()
102+
exam_event.startTime.getTime() &&
103+
timetable_event.endTime.getTime() ===
104+
exam_event.endTime.getTime()
103105
);
104106
});
105107
});

src/untis_utils/ints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ interface ILesson {
44
room: string;
55
startTime: Date;
66
endTime: Date;
7-
description: string | null;
7+
description?: string;
88
}
99

1010
interface IExam extends ILesson {

0 commit comments

Comments
 (0)