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