This commit is contained in:
MasutaYunikon committed 2026-04-10 21:06:55 +02:00
1 parent ef23a7119e
commit 08c4122d5e
1 file changed
+2 -2
+2 -2
View File
@@ -128,6 +128,7 @@ export async function scanMediaPath(
// Track les paires hash:episodeId présentes
const presentFiles = new Set<string>()
let noMatch = 0
function walk(dir: string) {
let entries: fs.Dirent[]
@@ -142,7 +143,7 @@ export async function scanMediaPath(
const nameWithoutExt = entry.name.replace(/\.[^.]+$/, '')
const match = filenameIndex.get(nameWithoutExt)
if (!match) {
// Trouver des candidats proches dans l'index (même début de nom)
noMatch++
const prefix = nameWithoutExt.slice(0, 20).toLowerCase()
const close = [...filenameIndex.keys()].filter(k => k.toLowerCase().startsWith(prefix)).slice(0, 3)
const closeStr = close.length > 0 ? ` | candidats : ${close.map(c => `"${c}"`).join(', ')}` : ' | aucun candidat proche'
@@ -195,7 +196,6 @@ export async function scanMediaPath(
fs.writeFileSync(organizedPath, JSON.stringify(organized, null, 2), 'utf-8')
}
const noMatch = result.found - result.added
logger.info('organize', `Scan terminé — ${result.found} fichiers, ${result.added} ajoutés, ${removed} orphelins supprimés${noMatch > 0 ? `, ${noMatch} non matchés` : ''}`)
return result