{
game.albums.map((a) => (
diff --git a/src/pages/game/list/index.astro b/src/pages/game/list/index.astro
index 5f344e5..49ac9ed 100644
--- a/src/pages/game/list/index.astro
+++ b/src/pages/game/list/index.astro
@@ -20,7 +20,7 @@ const letters: { letter: string; count: BigInt }[] = await prismaClient.$queryRa
letters.map((l) => (
{l.letter}
-
+
{Array.from({ length: Number(l.count) }).map(() => (
diff --git a/src/pages/platform/[id].astro b/src/pages/platform/[id].astro
new file mode 100644
index 0000000..e7ccdf7
--- /dev/null
+++ b/src/pages/platform/[id].astro
@@ -0,0 +1,45 @@
+---
+import prismaClient from 'utils/prisma-client'
+
+import LetterList from 'layouts/LetterList.astro'
+import PlatformGameList from 'components/letterList/PlatformGameList.astro'
+import { AlbumStatus } from '@prisma/client'
+
+const { id } = Astro.params
+
+if (!id) return Astro.redirect('/404')
+const platformId = parseInt(id)
+if (!platformId) return Astro.redirect('/404')
+
+const platform = await prismaClient.platform.findUnique({ where: { id: platformId }, select: { name: true } })
+if (!platform) return Astro.redirect('/404')
+
+const letters: { letter: string; count: BigInt }[] = await prismaClient.$queryRaw`
+ SELECT DISTINCT UPPER(LEFT(game.name, 1)) AS letter, COUNT(*) AS count
+ FROM game, platform, Game_Platform
+ WHERE game.slug = Game_Platform.gameSlug
+ AND platform.id = Game_Platform.platformId
+ AND platform.id = ${platformId}
+ GROUP BY letter
+ ORDER BY letter;
+`
+---
+
+
+ {
+ letters.map((l) => (
+
+
{l.letter}
+
+
+
+ {Array.from({ length: Number(l.count) }).map(() => (
+
+ ))}
+
+
+
+
+ ))
+ }
+
diff --git a/src/pages/platform/list/index.astro b/src/pages/platform/list/index.astro
index 6a5f297..a3f879d 100644
--- a/src/pages/platform/list/index.astro
+++ b/src/pages/platform/list/index.astro
@@ -21,7 +21,7 @@ const letters: { letter: string; count: BigInt }[] = await prismaClient.$queryRa
letters.map((l) => (
{l.letter}
-
+
{Array.from({ length: Number(l.count) }).map(() => (
diff --git a/src/pages/publisher/list/index.astro b/src/pages/publisher/list/index.astro
index f02c82c..b48887a 100644
--- a/src/pages/publisher/list/index.astro
+++ b/src/pages/publisher/list/index.astro
@@ -20,7 +20,7 @@ const letters: { letter: string; count: BigInt }[] = await prismaClient.$queryRa
letters.map((l) => (
{l.letter}
-
+
{Array.from({ length: Number(l.count) }).map(() => (
diff --git a/src/pages/series/[slug].astro b/src/pages/series/[slug].astro
new file mode 100644
index 0000000..7d2b459
--- /dev/null
+++ b/src/pages/series/[slug].astro
@@ -0,0 +1,188 @@
+---
+import prismaClient from 'utils/prisma-client'
+import * as m from 'paraglide/messages'
+import { getImage, Image } from 'astro:assets'
+import { SEO } from 'astro-seo'
+
+import BaseLayout from 'layouts/base.astro'
+import AlbumBox from 'components/AlbumBox.astro'
+import ReleaseDate from 'components/ReleaseDate.astro'
+
+const { slug } = Astro.params
+if (!slug) return Astro.redirect('/404')
+
+const series = await prismaClient.series.findUnique({
+ where: { slug },
+ select: {
+ name: true,
+ headerColor: true,
+ games: {
+ select: {
+ game: {
+ select: {
+ slug: true,
+ releaseDate: true,
+ name: true,
+ albums: {
+ select: {
+ album: { select: { id: true, title: true, games: { select: { gameSlug: true, game: true } } } }
+ }
+ }
+ }
+ }
+ },
+ orderBy: { game: { releaseDate: 'asc' } }
+ }
+ }
+})
+
+if (!series) return Astro.redirect('/404')
+
+const variousAlbums: { id: number; title: string | null }[] = []
+const singleAlbumsObj: {
+ [key: string]: {
+ albums: { id: number; title: string | null }[]
+ game: {
+ slug: string
+ name: string | null
+ createdAt: Date
+ updatedAt: Date
+ placeholder: string | null
+ headerColor: string | null
+ releaseDate: Date | null
+ }
+ }
+} = {}
+const checkedAlbums = new Set()
+
+series.games.forEach((g) => {
+ g.game.albums.forEach(({ album }) => {
+ if (checkedAlbums.has(album.id)) return
+ else checkedAlbums.add(album.id)
+
+ if (album.games.length > 1) {
+ variousAlbums.push(album)
+ } else {
+ const game = album.games[0]
+ if (!singleAlbumsObj[game.gameSlug]) {
+ singleAlbumsObj[game.gameSlug] = { albums: [], game: game.game }
+ }
+ singleAlbumsObj[game.gameSlug].albums.push(album)
+ }
+ })
+})
+
+const singleAlbums = Object.values(singleAlbumsObj).sort((a, b) => {
+ if (!a.game.releaseDate || !b.game.releaseDate) return 0
+ return b.game.releaseDate.getTime() - a.game.releaseDate.getTime()
+})
+const firstGame = series.games[0]?.game
+const lastGame = series.games[series.games.length - 1]?.game
+const coverImage = await getImage({
+ src: `https://cdn.sittingonclouds.net/game/${slug}.png`,
+ height: 150,
+ width: 150
+})
+---
+
+
+
+
+
+
+
+
+
+
{series.name}
+
+
+ {
+ firstGame.releaseDate ? (
+
+ | {m.firstRelease()}: |
+
+ -{' '}
+ {firstGame.name}
+ |
+
+ ) : null
+ }
+ {
+ lastGame.releaseDate ? (
+
+ | {m.newestRelease()}: |
+
+
+ -
+ {lastGame.name}
+ |
+
+ ) : null
+ }
+
+
+
+
+
+
+
+
+
{m.variousGames()}
+
+ {
+ variousAlbums.map((album) => (
+
+ ))
+ }
+
+
+
+ {
+ singleAlbums.map((s) => (
+
+
+ {s.game.releaseDate?.getFullYear()}
+ {s.game.name}
+
+
+ {s.albums.map((album) => (
+
+ ))}
+
+
+ ))
+ }
+
+
+
+
diff --git a/src/pages/studio/[slug].astro b/src/pages/studio/[slug].astro
new file mode 100644
index 0000000..00484e9
--- /dev/null
+++ b/src/pages/studio/[slug].astro
@@ -0,0 +1,58 @@
+---
+import prismaClient from 'utils/prisma-client'
+
+import DefaultSEO from 'components/DefaultSEO.astro'
+import BaseLayout from 'layouts/base.astro'
+import Sidebar from 'components/Sidebar.astro'
+import AlbumBox from 'components/AlbumBox.astro'
+
+const { slug } = Astro.params
+if (!slug) return Astro.redirect('/404')
+
+const studio = await prismaClient.studio.findUnique({
+ where: { slug },
+ select: {
+ name: true,
+ animations: {
+ select: {
+ animation: {
+ select: {
+ albums: {
+ select: { albumId: true, album: { select: { title: true, publishedAt: true } } }
+ }
+ }
+ }
+ }
+ }
+ }
+})
+
+if (!studio) return Astro.redirect('/404')
+
+const albumsMap = new Map()
+studio.animations.forEach((a) => {
+ a.animation.albums.forEach(({ albumId, album }) => {
+ albumsMap.set(albumId, album)
+ })
+})
+
+const albums = Array.from(albumsMap.entries())
+ .map(([id, data]) => ({ id, ...data }))
+ .sort((a, b) => a.publishedAt.getTime() - b.publishedAt.getTime())
+ .reverse()
+---
+
+
+
+
+
+
+ {studio.name}
+
+
+ {albums.map((a) =>
)}
+
+
+
+
+
diff --git a/src/pages/studio/list/index.astro b/src/pages/studio/list/index.astro
index 8cb35d4..6fec597 100644
--- a/src/pages/studio/list/index.astro
+++ b/src/pages/studio/list/index.astro
@@ -20,7 +20,7 @@ const letters: { letter: string; count: BigInt }[] = await prismaClient.$queryRa
letters.map((l) => (
{l.letter}
-
+
{Array.from({ length: Number(l.count) }).map(() => (
diff --git a/src/utils/releaseDate.ts b/src/utils/releaseDate.ts
deleted file mode 100644
index e134eb6..0000000
--- a/src/utils/releaseDate.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-const locale =
- navigator && navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language
-
-const releaseDate = (date: Date) => new Intl.DateTimeFormat(locale, { dateStyle: 'medium' }).format(date)
-
-export default releaseDate