From 0c34f2097dfd77361fbf94d6986d5d37da498b5e Mon Sep 17 00:00:00 2001 From: Johnny322 Date: Sun, 8 Feb 2026 16:17:10 +0100 Subject: [PATCH] dwadwa --- src/dataLoader.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/dataLoader.ts b/src/dataLoader.ts index c1fcb5e..d594a84 100644 --- a/src/dataLoader.ts +++ b/src/dataLoader.ts @@ -25,15 +25,15 @@ type GameMap = Record< } > -const songFiles = { - ...(import.meta as any).globEager('./Data/*/*/Songs/*.mp3'), - ...(import.meta as any).globEager('./Data/*/*/songs/*.mp3') -} as Record +const songFiles = import.meta.globEager('./Data/*/*/songs/*.mp3') as Record< + string, + { default: string } +> -const answerFiles = { - ...(import.meta as any).globEager('./Data/*/*/Answers/*.mp3'), - ...(import.meta as any).globEager('./Data/*/*/answers/*.mp3') -} as Record +const answerFiles = import.meta.globEager('./Data/*/*/answers/*.mp3') as Record< + string, + { default: string } +> const getParts = (path: string) => { const normalized = path.replace(/\\/g, '/') @@ -67,9 +67,7 @@ const addEntry = (target: GameMap, info: ReturnType, url: strin clues: [] } } - const normalizedType = type?.toLowerCase() - if (normalizedType !== 'songs' && normalizedType !== 'answers') return - const bucket = normalizedType === 'songs' ? 'songs' : 'answers' + const bucket = type === 'Songs' ? 'songs' : 'answers' target[game].categories[category][bucket][number] = url } @@ -80,7 +78,7 @@ const buildGameData = (): Game[] => { }) Object.entries(answerFiles).forEach(([path, module]) => { addEntry(games, getParts(path), module.default) - }) + }) return Object.values(games).map((game) => { const categories = Object.values(game.categories).map((category) => {