Actualiser js/admin.js
This commit is contained in:
+3
-4
@@ -412,18 +412,17 @@ async function handleCritiqueUpload(input) {
|
|||||||
loadDashboardData();
|
loadDashboardData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extraction de l'EAN et du titre du CSV
|
||||||
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ù
|
// On récupère aussi le titre du CSV pour s'en servir de secours
|
||||||
let title = row['title'] ? String(row['title']).trim() : '';
|
let title = row['title'] ? String(row['title']).trim() : '';
|
||||||
|
|
||||||
if (!ean && !title) return null;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ean: ean,
|
ean: ean,
|
||||||
title: title // Titre du CSV en backup
|
title: title
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user