yeah
All checks were successful
Deploy App / build (push) Successful in 10s
Deploy App / deploy (push) Successful in 11s

This commit is contained in:
valere
2026-02-02 21:00:28 +01:00
parent e257e076c4
commit b9a3d0184f
98 changed files with 5068 additions and 3713 deletions

View File

@@ -0,0 +1,21 @@
import { syncCardsWithDatabase } from '../../services/cardSync.service'
export default defineEventHandler(async (event) => {
const config = useRuntimeConfig()
const folderPath = config.pathFiles || process.env.PATH_FILES || 'mnt/media/files/music'
try {
const result = await syncCardsWithDatabase(folderPath)
return {
success: true,
...result
}
} catch (error: any) {
return {
success: false,
error: error.message,
stack: error.stack
}
}
})

View File

@@ -0,0 +1,29 @@
import { scanMusicFolder } from '../../utils/fileScanner'
export default defineEventHandler(async (event) => {
const config = useRuntimeConfig()
const folderPath = config.pathFiles || process.env.PATH_FILES || 'mnt/media/files/music'
try {
// Test 1: Vérifier que le dossier existe
const { access } = await import('node:fs/promises')
await access(folderPath)
// Test 2: Scanner le dossier
const cards = await scanMusicFolder(folderPath)
return {
success: true,
folderPath,
cardsFound: cards.length,
cards: cards.slice(0, 5), // Afficher seulement les 5 premiers
sample: cards[0] // Un exemple complet
}
} catch (error: any) {
return {
success: false,
error: error.message,
folderPath
}
}
})