test server NUXT_ env in nuxt config
All checks were successful
Deploy App / build (push) Successful in 1m6s
Deploy App / deploy (push) Successful in 18s

This commit is contained in:
valere
2026-02-10 20:59:18 +01:00
parent d89f2aa3e7
commit 0195c52d30
10 changed files with 21 additions and 17 deletions

View File

@@ -9,6 +9,9 @@ const listAudioExts = ['.mp3', '.opus', 'flac']
const listImageExts = ['.jpg', '.jpeg', '.webp']
export async function scanMusicFolder(folderPath: string): Promise<Card[]> {
const runtimeConfig = useRuntimeConfig()
const urlPrefix = runtimeConfig.NUXT_URL_PREFIX
try {
const files = await readdir(folderPath)
const cardMap = new Map<string, Card>()
@@ -30,14 +33,14 @@ export async function scanMusicFolder(folderPath: string): Promise<Card[]> {
for (const imgExt of listImageExts) {
const potentialImage = baseName + imgExt
if (files.includes(potentialImage)) {
imageUrl = process.env.NUXT_URL_PREFIX + baseName + imgExt
imageUrl = urlPrefix + baseName + imgExt
break
}
}
cardMap.set(parsed.esid, {
...parsed,
url_audio: process.env.NUXT_URL_PREFIX + baseName + ext,
url_audio: urlPrefix + baseName + ext,
url_image: imageUrl,
suit: parsed.suit,
rank: parsed.rank