From fd16d992eca11790c4b58fc6deff2d4661bee41d Mon Sep 17 00:00:00 2001 From: Cedric Date: Fri, 19 Jun 2026 20:25:17 +0200 Subject: [PATCH] Actualiser js/public.js --- js/public.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/public.js b/js/public.js index 9d0e205..7bee936 100644 --- a/js/public.js +++ b/js/public.js @@ -109,9 +109,12 @@ function renderPublicGrid() { // 1. Filtrage par type let filtered = films.filter(f => f.type === currentPubTab); - // 2. Filtre par note + // Filtre par note (regroupement : 5★ inclut 4.5, 4★ inclut 3.5, etc.) if (currentPubTab === 'critique' && activeRatingFilter > 0) { - filtered = filtered.filter(f => Math.round(parseFloat(f.rating)) === activeRatingFilter); + filtered = filtered.filter(f => { + const rating = parseFloat(f.rating) || 0; + return Math.round(rating) === activeRatingFilter; + }); } // 3. Filtre par plateforme (avec normalisation)