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

23
server/tasks/syncCards.ts Normal file
View File

@@ -0,0 +1,23 @@
import { syncCardsWithDatabase } from '../services/cardSync.service'
export default defineTask({
meta: {
name: 'sync-tracks',
description: 'Synchronise les tracks avec le système de fichiers'
},
async run() {
const config = useRuntimeConfig()
const folderPath = config.pathFiles || process.env.PATH_FILES || 'mnt/media/files/music'
console.log('⏰ [TASK] Démarrage de la synchronisation planifiée...')
try {
const result = await syncCardsWithDatabase(folderPath)
console.log('✅ [TASK] Synchronisation terminée:', result)
return { result }
} catch (error: any) {
console.error('❌ [TASK] Erreur lors de la synchronisation:', error)
return { error: error.message }
}
}
})