Actualiser js/admin.js
This commit is contained in:
+4
-9
@@ -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
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user