Save merged calendar to file with unique identifier
This commit is contained in:
parent
6c9af1f4e4
commit
84f4d4b855
|
@ -29,7 +29,7 @@ app.post('/merge', async (req, res) => {
|
||||||
}
|
}
|
||||||
// Generate a unique identifier for this set of calendars
|
// Generate a unique identifier for this set of calendars
|
||||||
const calendarId = crypto.randomBytes(16).toString('hex');
|
const calendarId = crypto.randomBytes(16).toString('hex');
|
||||||
|
|
||||||
// Fetch calendar data from URLs
|
// Fetch calendar data from URLs
|
||||||
const promises = calendars.map((calendar) => {
|
const promises = calendars.map((calendar) => {
|
||||||
return axios.get(calendar.url)
|
return axios.get(calendar.url)
|
||||||
|
@ -73,8 +73,8 @@ app.post('/merge', async (req, res) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Save merged calendar to file
|
// Save merged calendar to file with unique identifier
|
||||||
const filename = `merged-${Date.now()}.ics`;
|
const filename = `${calendarId}.ics`;
|
||||||
let icalString = `BEGIN:VCALENDAR
|
let icalString = `BEGIN:VCALENDAR
|
||||||
VERSION:2.0
|
VERSION:2.0
|
||||||
CALSCALE:GREGORIAN
|
CALSCALE:GREGORIAN
|
||||||
|
|
Loading…
Reference in New Issue