Compare commits

...

2 commits

Author SHA1 Message Date
3a6fe133da Add series field to game album pages
Some checks failed
/ build (push) Has been cancelled
2025-06-23 14:34:32 -06:00
99d10f92cd Fix animation and platform links 2025-06-23 14:25:46 -06:00

View file

@ -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}
</span>
) : (
<a class='btn btn-link p-0' href={`/platform/${id}`}>
<a class='btn btn-link p-0' href={`/platform/${platform.id}`}>
{platform.name}
</a>
)}
@ -197,6 +198,23 @@ const coverImage = await getImage({
</tr>
)
}
{
series.length > 0 && (
<tr>
<th class='mr-2'>{m.series()}</th>
<td>
{series.map((s, i) => (
<Fragment key={s.slug}>
<a class='btn btn-link p-0' href={`/series/${s.slug}`}>
{s.name}
</a>
{i !== series.length - 1 && ', '}
</Fragment>
))}
</td>
</tr>
)
}
{
(album?.games.length ?? 0) > 0 && (
<tr>
@ -221,7 +239,7 @@ const coverImage = await getImage({
<td>
{album?.animations.map(({ animation }, i) => (
<Fragment key={id}>
<a class='btn btn-link p-0' href={`/anim/${id}`}>
<a class='btn btn-link p-0' href={`/anim/${animation.id}`}>
{animation.title}
</a>
{i !== album?.animations.length - 1 && ', '}