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 } }, categories: { select: { categoryName: true } },
classifications: { select: { classificationName: true } }, classifications: { select: { classificationName: true } },
platforms: { select: { platform: { select: { id: true, name: 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 } } } }, animations: { select: { animation: { select: { id: true, title: true } } } },
stores: { select: { url: true, provider: true }, where: { NOT: { provider: 'SOON' } } }, stores: { select: { url: true, provider: true }, where: { NOT: { provider: 'SOON' } } },
discs: { select: { number: true, body: true } }, discs: { select: { number: true, body: true } },
@ -51,6 +51,7 @@ const album = await prismaClient.albums.findUnique({
if (!album) return Astro.redirect("/404"); if (!album) return Astro.redirect("/404");
const series = album.games.map(g => g.game.series).flat().map(s => s.series)
const { currentLocale } = Astro const { currentLocale } = Astro
const coverImage = await getImage({ const coverImage = await getImage({
src: `https://cdn.sittingonclouds.net/album/${album?.id}.png`, src: `https://cdn.sittingonclouds.net/album/${album?.id}.png`,
@ -186,7 +187,7 @@ const coverImage = await getImage({
{platform.name} {platform.name}
</span> </span>
) : ( ) : (
<a class='btn btn-link p-0' href={`/platform/${id}`}> <a class='btn btn-link p-0' href={`/platform/${platform.id}`}>
{platform.name} {platform.name}
</a> </a>
)} )}
@ -197,6 +198,23 @@ const coverImage = await getImage({
</tr> </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 && ( (album?.games.length ?? 0) > 0 && (
<tr> <tr>
@ -221,7 +239,7 @@ const coverImage = await getImage({
<td> <td>
{album?.animations.map(({ animation }, i) => ( {album?.animations.map(({ animation }, i) => (
<Fragment key={id}> <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} {animation.title}
</a> </a>
{i !== album?.animations.length - 1 && ', '} {i !== album?.animations.length - 1 && ', '}