From 4933f86f3026bdd11195380b296d972b0a0ae852 Mon Sep 17 00:00:00 2001 From: Cedric Date: Mon, 26 Oct 2026 10:13:38 +0100 Subject: [PATCH] Actualiser js/public.js --- js/public.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/js/public.js b/js/public.js index 0e2f219..82a9223 100644 --- a/js/public.js +++ b/js/public.js @@ -18,18 +18,22 @@ function getStarsHTML(rating) { return html; } +// "Support physique / Cinéma" (ou l'ancien libellé) n'est pas une plateforme de streaming +function isPhysicalLabel(value) { + const v = String(value || '').toLowerCase(); + return v.includes('support physique'); +} + function generateStreamingSelect() { const select = document.getElementById('pub-streaming-select'); if (!select) return; - + const platforms = new Set(); films.forEach(f => { - if (f.type === 'critique' && f.streaming && - f.streaming !== 'Disponible en support physique ou Cinéma' && - f.streaming.trim() !== '') { + if (f.type === 'critique' && f.streaming && f.streaming.trim() !== '') { f.streaming.split(',').forEach(p => { const platform = p.trim(); - if (platform.length > 0) platforms.add(platform); + if (platform.length > 0 && !isPhysicalLabel(platform)) platforms.add(platform); }); } }); @@ -151,7 +155,7 @@ function renderPublicGrid() { if (currentPubTab === 'critique' && activeStreamingFilter) { const filterLower = activeStreamingFilter.toLowerCase(); filtered = filtered.filter(f => { - if (!f.streaming || f.streaming === 'Disponible en support physique ou Cinéma') return false; + if (!f.streaming || isPhysicalLabel(f.streaming)) return false; const platforms = f.streaming.split(',').map(p => p.trim().toLowerCase()); return platforms.includes(filterLower); });