Actualiser js/public.js

This commit is contained in:
2026-06-19 20:25:17 +02:00
parent 8a3fb207e0
commit fd16d992ec
+5 -2
View File
@@ -109,9 +109,12 @@ function renderPublicGrid() {
// 1. Filtrage par type // 1. Filtrage par type
let filtered = films.filter(f => f.type === currentPubTab); 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) { 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) // 3. Filtre par plateforme (avec normalisation)