@bebranded/bb-contents 1.0.9-beta → 1.0.11-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bb-contents.js +3 -11
- package/package.json +1 -1
package/bb-contents.js
CHANGED
|
@@ -468,7 +468,7 @@
|
|
|
468
468
|
container.innerHTML = '<div style="padding: 20px; text-align: center; color: #6b7280;">Chargement des vidéos YouTube...</div>';
|
|
469
469
|
|
|
470
470
|
// Appeler l'API via le Worker
|
|
471
|
-
fetch(`${endpoint}?channelId=${channelId}&maxResults=${videoCount}`)
|
|
471
|
+
fetch(`${endpoint}?channelId=${channelId}&maxResults=${videoCount}&allowShorts=${allowShorts}`)
|
|
472
472
|
.then(response => {
|
|
473
473
|
if (!response.ok) {
|
|
474
474
|
throw new Error(`HTTP ${response.status}`);
|
|
@@ -494,17 +494,9 @@
|
|
|
494
494
|
return;
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
-
//
|
|
497
|
+
// Les vidéos sont déjà filtrées par l'API YouTube selon allowShorts
|
|
498
498
|
let videos = data.items;
|
|
499
|
-
|
|
500
|
-
videos = videos.filter(item => {
|
|
501
|
-
// Filtrer les shorts (vidéos de moins de 60 secondes ou avec #shorts dans le titre)
|
|
502
|
-
const title = item.snippet.title.toLowerCase();
|
|
503
|
-
const description = item.snippet.description.toLowerCase();
|
|
504
|
-
return !title.includes('#shorts') && !description.includes('#shorts');
|
|
505
|
-
});
|
|
506
|
-
bbContents.utils.log(`Filtrage des shorts: ${data.items.length} → ${videos.length} vidéos`);
|
|
507
|
-
}
|
|
499
|
+
bbContents.utils.log(`Vidéos reçues de l'API: ${videos.length} (allowShorts: ${allowShorts})`);
|
|
508
500
|
|
|
509
501
|
// Vider le conteneur
|
|
510
502
|
container.innerHTML = '';
|