try fix .env with NUXT_ prefix
This commit is contained in:
@@ -10,7 +10,6 @@ const listImageExts = ['.jpg', '.jpeg', '.webp']
|
||||
|
||||
export async function scanMusicFolder(folderPath: string): Promise<Card[]> {
|
||||
try {
|
||||
const config = useRuntimeConfig()
|
||||
const files = await readdir(folderPath)
|
||||
const cardMap = new Map<string, Card>()
|
||||
|
||||
@@ -31,14 +30,14 @@ export async function scanMusicFolder(folderPath: string): Promise<Card[]> {
|
||||
for (const imgExt of listImageExts) {
|
||||
const potentialImage = baseName + imgExt
|
||||
if (files.includes(potentialImage)) {
|
||||
imageUrl = config.URL_PREFIX + baseName + imgExt
|
||||
imageUrl = process.env.NUXT_URL_PREFIX + baseName + imgExt
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
cardMap.set(parsed.esid, {
|
||||
...parsed,
|
||||
url_audio: config.URL_PREFIX + baseName + ext,
|
||||
url_audio: process.env.NUXT_URL_PREFIX + baseName + ext,
|
||||
url_image: imageUrl,
|
||||
suit: parsed.suit,
|
||||
rank: parsed.rank
|
||||
|
||||
Reference in New Issue
Block a user