Fix dataLoader
Some checks failed
On Push Deploy / deploy (push) Has been cancelled

This commit is contained in:
Johnny322
2026-02-08 16:38:00 +01:00
parent 8ad6b96f02
commit d19c73f298

View File

@@ -25,15 +25,15 @@ type GameMap = Record<
} }
> >
const songFiles = { const songFiles = import.meta.globEager('./Data/*/*/songs/*.mp3') as Record<
...import.meta.globEager('./Data/*/*/Songs/*.mp3'), string,
...import.meta.globEager('./Data/*/*/songs/*.mp3') { default: string }
} as Record<string, { default: string }> >
const answerFiles = { const answerFiles = import.meta.globEager('./Data/*/*/answers/*.mp3') as Record<
...import.meta.globEager('./Data/*/*/Answers/*.mp3'), string,
...import.meta.globEager('./Data/*/*/answers/*.mp3') { default: string }
} as Record<string, { default: string }> >
const getParts = (path: string) => { const getParts = (path: string) => {
const normalized = path.replace(/\\/g, '/') const normalized = path.replace(/\\/g, '/')
@@ -54,7 +54,7 @@ const getParts = (path: string) => {
const addEntry = (target: GameMap, info: ReturnType<typeof getParts>, url: string) => { const addEntry = (target: GameMap, info: ReturnType<typeof getParts>, url: string) => {
if (!info) return if (!info) return
const { game, category, type, file } = info const { game, category, type, file } = info
const number = Number(file.replace(/\.mp3$/i, '')) const number = Number(file.replace('.mp3', ''))
if (!Number.isFinite(number)) return if (!Number.isFinite(number)) return
if (!target[game]) { if (!target[game]) {