feat(pwa-offline): Pinia store + IndexedDB; contexto para cache/eliminación; toasts; compatibilidad PWA offline
- Agrega @pinia/nuxt, idb y store central (stores/music.ts) - Cacheo manual desde menú contextual y borrado (TrackContextMenu) - Ícono verde para canciones cacheadas, sin auto-cache al reproducir - Toasts de feedback (stores/toast.ts, ToastContainer) - Fallback offline de listado a IndexedDB; fix MUSIC_DIR absoluto en preview/prod - Ajustes PWA: navigateFallback '/', devOptions, workbox condicional - Estilos y animación del context menu (tema light/dark, blur fuerte) - Correcciones de sintaxis y posicionamiento exacto al cursor
This commit is contained in:
@@ -30,9 +30,9 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
// Determine the music directory path
|
||||
let musicDir: string
|
||||
if (process.env.MUSIC_DIR) {
|
||||
// If MUSIC_DIR is set, resolve it (handles both absolute and relative paths)
|
||||
musicDir = resolve(process.cwd(), process.env.MUSIC_DIR)
|
||||
if (config.musicDirAbs || process.env.MUSIC_DIR) {
|
||||
// Prefer absolute dir from runtimeConfig; fallback to env (resolved relative to repo root at build time)
|
||||
musicDir = (config.musicDirAbs as string) || resolve(process.cwd(), process.env.MUSIC_DIR!)
|
||||
} else {
|
||||
// Fallback to public/music
|
||||
const defaultPublicPath = config.public?.musicPath || '/music'
|
||||
|
||||
Reference in New Issue
Block a user