UI mejorada

This commit is contained in:
2025-08-10 00:45:59 -06:00
parent 2f878a857a
commit 493d236dc4
8 changed files with 56 additions and 25 deletions

View File

@@ -8,7 +8,10 @@ export default defineEventHandler(async (event) => {
const realIP = headers['x-real-ip'] || headers['x-forwarded-for'] || 'unknown'
console.log(`[MUSIC API] Music list request from ${realIP}`)
const musicDir = join(process.cwd(), 'public', 'music')
const config = useRuntimeConfig()
const defaultPublicPath = config.public?.musicPath || '/music'
const publicRel = defaultPublicPath.replace(/^\//, '')
const musicDir = process.env.MUSIC_DIR || join(process.cwd(), 'public', publicRel)
// Check if music directory exists
try {
@@ -54,4 +57,4 @@ export default defineEventHandler(async (event) => {
statusMessage: 'Failed to load music files'
})
}
})
})