add adapter for filmspourenfants

This commit is contained in:
2025-05-18 20:57:10 +02:00
parent e3f0f39a9d
commit dfcceb0f7d
2 changed files with 237 additions and 2 deletions

View File

@ -4,6 +4,7 @@ const cinecheck = require('./aggregators/cinecheck-adapter');
const commonsense = require('./aggregators/commonsense-adapter');
const filmages = require('./aggregators/filmages-adapter');
const filmstouspublics = require('./aggregators/filmstouspublics-adapter');
const filmspourenfants = require('./aggregators/filmspourenfants-adapter');
const { mergeResults } = require('./merge');
const app = express();
@ -19,7 +20,7 @@ app.get('/search', async (req, res) => {
console.log('Query:', q);
try {
const [cine, cs, fa, ftp] = await Promise.all([
const [cine, cs, fa, ftp, fpe] = await Promise.all([
cinecheck.searchAndEnrich(q).catch(e => {
console.error('Cinecheck failed:', e.message);
return [];
@ -35,6 +36,10 @@ app.get('/search', async (req, res) => {
filmstouspublics.searchAndEnrich(q).catch(e => {
console.error('FilmsTousPublics failed:', e.message);
return [];
}),
filmspourenfants.searchAndEnrich(q).catch(e => {
console.error('FilmsPourEnfants failed:', e.message);
return [];
})
]);
@ -42,8 +47,9 @@ app.get('/search', async (req, res) => {
console.log('CSM results:', cs.length);
console.log('Filmages results:', fa.length);
console.log('FilmsTousPublics results:', ftp.length);
console.log('FilmsPourEnfants results:', fpe.length);
const merged = mergeResults([cine, cs, fa, ftp]);
const merged = mergeResults([cine, cs, fa, ftp, fpe]);
res.json(merged);
} catch (e) {
console.error('General search error:', e);