Actualiser js/admin.js

This commit is contained in:
2026-06-30 12:41:02 +02:00
parent 1cc4b6094b
commit b595b065a3
+4 -9
View File
@@ -412,23 +412,18 @@ async function handleCritiqueUpload(input) {
loadDashboardData(); loadDashboardData();
} }
// Extraction des données du CSV + EAN
function normalizeVideothequeRow(row) { function normalizeVideothequeRow(row) {
let ean = row['ean_isbn13'] || row['EAN'] || row['ean'] || row['Barcode'] || row['UPC'] || row['upc_isbn10'] || ''; let ean = row['ean_isbn13'] || row['EAN'] || row['ean'] || row['Barcode'] || row['UPC'] || row['upc_isbn10'] || '';
if (ean) ean = String(ean).replace(/[^0-9]/g, ''); if (ean) ean = String(ean).replace(/[^0-9]/g, '');
// On garde aussi le titre du CSV au cas où
let title = row['title'] ? String(row['title']).trim() : ''; let title = row['title'] ? String(row['title']).trim() : '';
if (!ean && !title) return null; // On garde la ligne si au moins le titre ou l'EAN existe
if (!ean && !title) return null;
return { return {
ean: ean, ean: ean,
title: title, title: title // Titre du CSV en backup
publisher: row['publisher'] || '',
length: row['length'] || '',
number_of_discs: row['number_of_discs'] || 1,
aspect_ratio: row['aspect_ratio'] || '',
description: row['description'] || '',
actors: row['creators'] || '' // Le CSV utilise 'creators' pour le casting/réalisateur
}; };
} }