feat(preferences): section langues a telecharger (defaut fr+en), transcripts filtres cote serveur et watch
CI / build-and-test (push) Successful in 13m50s

This commit is contained in:
2026-09-26 11:49:56 -04:00
parent 1b0a7eb3ce
commit 655061ba2c
46 changed files with 2018 additions and 380 deletions
+27
View File
@@ -47,6 +47,33 @@ const handler = {
console.error('Dailymotion search error:', error);
return [];
}
},
/**
* Typeahead suggestions for Dailymotion (no native suggest API):
* reuses search titles, deduped. Step 15 — never throws.
* @param {string} q
* @param {{ limit?: number }} [opts]
* @returns {Promise<string[]>}
*/
async suggest(q, opts) {
const limit = Math.min(20, Math.max(1, Number(opts?.limit || 10)));
const query = String(q || '').trim();
if (query.length < 2) return [];
try {
const items = await handler.search(query, { limit });
const seen = new Set();
const out = [];
for (const it of items || []) {
const t = String(it?.title || '').trim();
if (!t || seen.has(t.toLowerCase())) continue;
seen.add(t.toLowerCase());
out.push(t);
if (out.length >= limit) break;
}
return out;
} catch {
return [];
}
}
};
export default handler;