Add matter
Some checks failed
On Push Deploy / deploy (push) Has been cancelled

This commit is contained in:
Johnny322
2026-02-08 16:05:10 +01:00
parent a4f4e1728a
commit 54cf7d870c
2 changed files with 39 additions and 17 deletions

View File

@@ -25,15 +25,15 @@ type GameMap = Record<
}
>
const songFiles = import.meta.globEager('./Data/*/*/Songs/*.mp3') as Record<
string,
{ default: string }
>
const songFiles = {
...import.meta.globEager('./Data/*/*/Songs/*.mp3'),
...import.meta.globEager('./Data/*/*/songs/*.mp3')
} as Record<string, { default: string }>
const answerFiles = import.meta.globEager('./Data/*/*/Answers/*.mp3') as Record<
string,
{ default: string }
>
const answerFiles = {
...import.meta.globEager('./Data/*/*/Answers/*.mp3'),
...import.meta.globEager('./Data/*/*/answers/*.mp3')
} as Record<string, { default: string }>
const getParts = (path: string) => {
const normalized = path.replace(/\\/g, '/')
@@ -67,7 +67,9 @@ const addEntry = (target: GameMap, info: ReturnType<typeof getParts>, url: strin
clues: []
}
}
const bucket = type === 'Songs' ? 'songs' : 'answers'
const normalizedType = type?.toLowerCase()
if (normalizedType !== 'songs' && normalizedType !== 'answers') return
const bucket = normalizedType === 'songs' ? 'songs' : 'answers'
target[game].categories[category][bucket][number] = url
}