This commit is contained in:
@@ -25,15 +25,15 @@ type GameMap = Record<
|
||||
}
|
||||
>
|
||||
|
||||
const songFiles = {
|
||||
...import.meta.globEager('./Data/*/*/Songs/*.mp3'),
|
||||
...import.meta.globEager('./Data/*/*/songs/*.mp3')
|
||||
} as Record<string, { default: string }>
|
||||
const songFiles = import.meta.globEager('./Data/*/*/songs/*.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 answerFiles = import.meta.globEager('./Data/*/*/answers/*.mp3') as Record<
|
||||
string,
|
||||
{ default: string }
|
||||
>
|
||||
|
||||
const getParts = (path: string) => {
|
||||
const normalized = path.replace(/\\/g, '/')
|
||||
@@ -54,7 +54,7 @@ const getParts = (path: string) => {
|
||||
const addEntry = (target: GameMap, info: ReturnType<typeof getParts>, url: string) => {
|
||||
if (!info) return
|
||||
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 (!target[game]) {
|
||||
|
||||
Reference in New Issue
Block a user