feat: popular categories

This commit is contained in:
2024-05-15 15:07:10 +01:00
parent daa687957e
commit 2bc996d981
14 changed files with 237 additions and 29 deletions

View File

@ -172,6 +172,18 @@ export function extractGameTag(tags: Array<string>) {
};
}
}
if (gameId === undefined) {
const lowerTags = tags.map(a => a.toLowerCase());
const anyCat = AllCategories.find(a => a.tags.some(b => lowerTags.includes(b)));
if (anyCat) {
gameInfo = {
id: anyCat?.id,
name: anyCat.name,
genres: anyCat.tags,
className: anyCat.className,
};
}
}
return { gameInfo, gameId };
}