feat(suggest): enrichissement web gratuit (Bing+Google) et titres Odysee Lighthouse
This commit is contained in:
@@ -45,8 +45,7 @@ function logOk(msg: string): void {
|
||||
logOk('dedupeSort alpha fallback');
|
||||
|
||||
// --- Pure helpers: merge groups ---
|
||||
const merged = mergeGroups({ dm: ['Tutoriel android'], yt: ['Tutoriel Angular', 'tutoriel android'], xx: ['zz'] });
|
||||
assertEqual(
|
||||
const merged = mergeGroups({ dm: ['Tutoriel android'], yt: ['Tutoriel Angular', 'tutoriel android'], xx: ['zz'] }); assertEqual(
|
||||
merged,
|
||||
[
|
||||
{ text: 'Tutoriel Angular', provider: 'yt' },
|
||||
@@ -57,6 +56,18 @@ function logOk(msg: string): void {
|
||||
);
|
||||
logOk('mergeGroups order + dedup');
|
||||
|
||||
// Web enrichment group renders last and stays deduped against providers
|
||||
const mergedWeb = mergeGroups({ web: ['Tutoriel angular', 'tutoriel cuisine'], yt: ['Tutoriel Angular'] });
|
||||
assertEqual(
|
||||
mergedWeb,
|
||||
[
|
||||
{ text: 'Tutoriel Angular', provider: 'yt' },
|
||||
{ text: 'tutoriel cuisine', provider: 'web' },
|
||||
],
|
||||
'mergeGroups keeps web enrichment last with no duplicates',
|
||||
);
|
||||
logOk('mergeGroups web tier');
|
||||
|
||||
// --- Pure helpers: dedupeStrings (whitespace + case variants) ---
|
||||
assertEqual(
|
||||
dedupeStrings([' Tutoriel Angular ', 'tutoriel angular', 'TUTORIEL ANGULAR', 'autre', '', ' ']),
|
||||
|
||||
@@ -318,6 +318,7 @@ export class SearchBoxComponent {
|
||||
|
||||
providerBadge(pid: string | null): string {
|
||||
if (!pid) return '';
|
||||
if (pid === 'web') return 'Web';
|
||||
const found = PROVIDERS.find((p) => p.id === (pid as ProviderId));
|
||||
return found ? found.shortLabel : String(pid).toUpperCase();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user