diff --git a/src/pages/album/[id].astro b/src/pages/album/[id].astro index 946a198..1bfc114 100644 --- a/src/pages/album/[id].astro +++ b/src/pages/album/[id].astro @@ -34,7 +34,6 @@ const album = await prismaClient.albums.findUnique({ if (!album) { Astro.response.status = 404 Astro.response.statusText = 'Not found' - return } const { currentLocale } = Astro --- @@ -53,8 +52,8 @@ const { currentLocale } = Astro
| {m.releaseDate()} | -{new Intl.DateTimeFormat(currentLocale, { dateStyle: 'medium' }).format(album.releaseDate)} | ++ {new Intl.DateTimeFormat(currentLocale, { dateStyle: 'medium' }).format(album?.releaseDate)} + |
|---|---|---|
| {m.artists()} | -{album.artistList.map(({ artist }) => artist.name).join(', ')} | +{album?.artistList.map(({ artist }) => artist.name).join(', ')} | { [ - album.categoryList.map(({ categoryName }) => (m as any)[`${categoryName}Osts`]()).join(' & '), - album.classificationList.map(({ classificationName }) => classificationName).join(', ') + album?.categoryList.map(({ categoryName }) => (m as any)[`${categoryName}Osts`]()).join(' & '), + album?.classificationList.map(({ classificationName }) => classificationName).join(', ') ] .filter((f) => f !== '') .join(' - ') @@ -100,23 +101,23 @@ const { currentLocale } = Astro | { - album.label && ( + album?.label && (
| {m.publishedBy()} | - - {album.label} + + {album?.label} | |
| {m.platforms()} |
- {album.platformList.map(({ platform }, i) => (
+ {album?.platformList.map(({ platform }, i) => (
|
@@ -135,16 +136,16 @@ const { currentLocale } = Astro
)
}
{
- album.gameList.length > 0 && (
+ (album?.gameList.length ?? 0) > 0 && (
|
| {m.games()} |
- {album.gameList.map(({ game }, i) => (
+ {album?.gameList.map(({ game }, i) => (
|
@@ -152,16 +153,16 @@ const { currentLocale } = Astro
)
}
{
- album.animList.length > 0 && (
+ (album?.animList.length ?? 0) > 0 && (
|
| {m.animations()} |
- {album.animList.map(({ animation }, i) => (
+ {album?.animList.map(({ animation }, i) => (
|
@@ -172,12 +173,12 @@ const { currentLocale } = Astro
|
| {m.avgRating()} | - + |