feat: initial commit

This commit is contained in:
Cory Dransfeldt 2024-11-16 16:43:07 -08:00
commit 0ff7457679
No known key found for this signature in database
192 changed files with 24379 additions and 0 deletions

View file

@ -0,0 +1,27 @@
import { albumReleasesCalendar } from "@utils/albumReleasesCalendar.js";
import { fetchAlbumReleases } from "@utils/data/albumReleases.js";
export const prerender = true;
export async function GET() {
try {
const { all: albumReleases } = await fetchAlbumReleases();
const icsContent = await albumReleasesCalendar(albumReleases);
if (!icsContent)
return new Response("Error generating ICS file", { status: 500 });
return new Response(icsContent, {
status: 200,
headers: {
"Content-Type": "text/calendar",
"Content-Disposition": 'attachment; filename="releases.ics"',
},
});
} catch (error) {
console.error("Error generating album releases ICS file:", error);
return new Response("Error generating album releases ICS file", {
status: 500,
});
}
}