diff --git a/astro.config.mjs b/astro.config.mjs
index 5063d8f..ae87b2a 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -52,7 +52,6 @@ export default defineConfig({
'/anim/[id]': { status: 307, destination: '/maintenance' },
'/anim/list': { status: 307, destination: '/maintenance' },
'/game/[slug]': { status: 307, destination: '/maintenance' },
- '/game/list': { status: 307, destination: '/maintenance' },
'/platform/list': { status: 307, destination: '/maintenance' },
'/platform/[id]': { status: 307, destination: '/maintenance' },
'/profile': { status: 307, destination: '/maintenance' },
diff --git a/src/components/albumList/letterSection.astro b/src/components/letterList/AlbumList.astro
similarity index 67%
rename from src/components/albumList/letterSection.astro
rename to src/components/letterList/AlbumList.astro
index 23c6b49..fe5dc90 100644
--- a/src/components/albumList/letterSection.astro
+++ b/src/components/letterList/AlbumList.astro
@@ -13,12 +13,10 @@ const albums = await prismaClient.albums.findMany({
})
---
-
+{
+ albums.map((a) => (
+
+ {a.title}
+
+ ))
+}
diff --git a/src/components/letterList/GameList.astro b/src/components/letterList/GameList.astro
new file mode 100644
index 0000000..34bd1fe
--- /dev/null
+++ b/src/components/letterList/GameList.astro
@@ -0,0 +1,21 @@
+---
+import prismaClient from 'utils/prisma-client'
+
+interface Props {
+ letter: string
+}
+
+const { letter } = Astro.props
+const games = await prismaClient.game.findMany({
+ where: { name: { startsWith: letter } },
+ select: { slug: true, name: true }
+})
+---
+
+{
+ games.map((a) => (
+
+ {a.name}
+
+ ))
+}
diff --git a/src/layouts/LetterList.astro b/src/layouts/LetterList.astro
new file mode 100644
index 0000000..da29477
--- /dev/null
+++ b/src/layouts/LetterList.astro
@@ -0,0 +1,37 @@
+---
+interface Props {
+ letters: { letter: string; count: BigInt }[]
+}
+
+import BaseLayout from 'layouts/base.astro'
+import Sidebar from 'components/Sidebar.astro'
+import DefaultSEO from 'components/DefaultSEO.astro'
+
+const { letters } = Astro.props
+---
+
+
+
+
+
+
+ {
+ letters.map((l) => (
+
+ ))
+ }
+
+
+
+
+
+
+
+
diff --git a/src/pages/album/list/index.astro b/src/pages/album/list/index.astro
index eeecc0c..6f42914 100644
--- a/src/pages/album/list/index.astro
+++ b/src/pages/album/list/index.astro
@@ -1,59 +1,33 @@
---
import prismaClient from 'utils/prisma-client'
-import BaseLayout from 'layouts/base.astro'
-import Sidebar from 'components/Sidebar.astro'
-import LetterSection from 'components/albumList/letterSection.astro'
-import DefaultSEO from 'components/DefaultSEO.astro'
+import LetterList from 'layouts/LetterList.astro'
+import AlbumList from 'components/letterList/AlbumList.astro'
const letters: { letter: string; count: BigInt }[] = await prismaClient.$queryRaw`
- SELECT DISTINCT UPPER(LEFT(title, 1)) AS letter, COUNT(*) AS count
- FROM albums
- WHERE status = 'SHOW'
- GROUP BY letter
- ORDER BY letter;
- `
+ SELECT DISTINCT UPPER(LEFT(title, 1)) AS letter, COUNT(*) AS count
+ FROM albums
+ WHERE status = 'SHOW'
+ GROUP BY letter
+ ORDER BY letter;
+`
---
-
-
-
-
-
- {
- letters.map((l) => (
-
- ))
- }
+
+ {
+ letters.map((l) => (
+
+
{l.letter}
+
+
+
+ {Array.from({ length: Number(l.count) }).map(() => (
+
+ ))}
+
+
+
-
- {
- letters.map((l) => (
-
-
{l.letter}
-
-
-
-
- {Array.from({ length: Number(l.count) }).map(() => (
-
- ))}
-
-
-
-
-
- ))
- }
-
-
-
-
-
+ ))
+ }
+
diff --git a/src/pages/game/list/index.astro b/src/pages/game/list/index.astro
new file mode 100644
index 0000000..5f344e5
--- /dev/null
+++ b/src/pages/game/list/index.astro
@@ -0,0 +1,35 @@
+---
+import prismaClient from 'utils/prisma-client'
+
+import LetterList from 'layouts/LetterList.astro'
+import GameList from 'components/letterList/GameList.astro'
+
+const letters: { letter: string; count: BigInt }[] = await prismaClient.$queryRaw`
+ SELECT DISTINCT UPPER(LEFT(name, 1)) AS letter, COUNT(*) AS count
+ FROM Album_Game, albums, game
+ WHERE Album_Game.albumId = albums.id
+ AND Album_Game.gameSlug = game.slug
+ AND albums.status = "Show"
+ GROUP BY letter
+ ORDER BY letter;
+`
+---
+
+
+ {
+ letters.map((l) => (
+
+
{l.letter}
+
+
+
+ {Array.from({ length: Number(l.count) }).map(() => (
+
+ ))}
+
+
+
+
+ ))
+ }
+