diff --git a/.gitignore b/.gitignore index ee58d8d..1884f30 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules/ test/calendar/ calendar/ -logs/ \ No newline at end of file +logs/ +.qodo diff --git a/.qodo/history.sqlite b/.qodo/history.sqlite deleted file mode 100644 index 770235c..0000000 Binary files a/.qodo/history.sqlite and /dev/null differ diff --git a/src/routes.js b/src/routes.js index a0f4546..bd758c6 100644 --- a/src/routes.js +++ b/src/routes.js @@ -57,7 +57,12 @@ async function refreshCalendarData(calendarName) { // Serve the merged calendar file and refresh if older than an hour router.get('/calendar/:name', async (req, res) => { - const calendarName = req.params.name; + // Extract the calendar name and remove .ics extension if present + let calendarName = req.params.name; + if (calendarName.endsWith('.ics')) { + calendarName = calendarName.slice(0, -4); + } + const icsFilePath = path.join(MERGED_CALENDARS_DIR, `${calendarName}.ics`); try { @@ -82,4 +87,4 @@ router.get('/calendar/:name', async (req, res) => { } }); -export default router; +export default router; \ No newline at end of file