diff --git a/src/pages/album/[id].astro b/src/pages/album/[id].astro index 4f335b8..28e58ec 100644 --- a/src/pages/album/[id].astro +++ b/src/pages/album/[id].astro @@ -35,7 +35,7 @@ const album = await prismaClient.albums.findUnique({ categories: { select: { categoryName: true } }, classifications: { select: { classificationName: true } }, platforms: { select: { platform: { select: { id: true, name: true } } } }, - games: { select: { game: { select: { slug: true, name: true } } } }, + games: { select: { game: { select: { slug: true, name: true,series: {select: {series: {select: {slug: true, name: true}}}} } } } }, animations: { select: { animation: { select: { id: true, title: true } } } }, stores: { select: { url: true, provider: true }, where: { NOT: { provider: 'SOON' } } }, discs: { select: { number: true, body: true } }, @@ -51,6 +51,7 @@ const album = await prismaClient.albums.findUnique({ if (!album) return Astro.redirect("/404"); +const series = album.games.map(g => g.game.series).flat().map(s => s.series) const { currentLocale } = Astro const coverImage = await getImage({ src: `https://cdn.sittingonclouds.net/album/${album?.id}.png`, @@ -186,7 +187,7 @@ const coverImage = await getImage({ {platform.name} ) : ( - + {platform.name} )} @@ -197,6 +198,23 @@ const coverImage = await getImage({ ) } + { + series.length > 0 && ( + + {m.series()} + + {series.map((s, i) => ( + + + {s.name} + + {i !== series.length - 1 && ', '} + + ))} + + + ) + } { (album?.games.length ?? 0) > 0 && ( @@ -221,7 +239,7 @@ const coverImage = await getImage({ {album?.animations.map(({ animation }, i) => ( - + {animation.title} {i !== album?.animations.length - 1 && ', '}