limit results, improve age display

This commit is contained in:
2025-05-25 01:13:25 +02:00
parent f8e9443ef8
commit 41a4ea5837
5 changed files with 169 additions and 107 deletions

View File

@ -45,6 +45,11 @@ async function getMovieClassification(movieUrl) {
const label = $(el).find('span.vh').text().trim();
if (label) marks.push(label);
});
const normalizedMarks = marks.map(m => {
// Extract first number found, else null
const n = parseInt((m + '').replace(/\D/g, ''), 10);
return isNaN(n) ? null : n;
}).filter(x => x !== null);
const details = [];
$('.c-classificatie__item').each((_, el) => {
const type = $(el).find('svg use').first().attr('xlink:href') || '';
@ -61,6 +66,7 @@ async function getMovieClassification(movieUrl) {
genres,
img,
marks,
normalizedMarks,
details,
summary
};