Skip to content

Commit 4d12bd9

Browse files
committed
Calendar: Add ctftime event id and default for empty pad domain
1 parent 4e56a02 commit 4d12bd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api/src/routes/ical.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ export function icalRoute(pool: Pool): Handler {
5454
const ctfs = await getCtfs();
5555

5656
for (const ctf of ctfs) {
57+
const ctftime_id = ctf.ctftime_url?.replace(/\/$/, "").split("/").at(-1);
5758
cal.createEvent({
58-
id: `${ctf.id}@${config.pad.domain}`,
59+
id: `${ctf.id}:${ctftime_id || "no-ctftime"}@${config.pad.domain || "ctfnote"}`,
5960
start: ctf.start_time,
6061
end: ctf.end_time,
6162
description: ctf.description,

0 commit comments

Comments
 (0)