feat: add race cover image extraction
Some checks failed
CI / build-and-test (pull_request) Has been cancelled

This commit is contained in:
Vaka.pro
2026-04-27 22:56:41 +03:00
parent 0b7ad23252
commit 0153f223f2
15 changed files with 295 additions and 8 deletions

View File

@@ -187,6 +187,15 @@ function getFallbackRaceVisual(race: Race): RaceVisual {
export function getRaceVisual(race: Race): RaceVisual {
const fallback = getFallbackRaceVisual(race);
if (race.coverImageUrl) {
return {
...fallback,
imageSrc: race.coverImageUrl,
fallbackSrc: fallback.imageSrc,
};
}
const title = normalizeTitle(race.title);
const official = OFFICIAL_VISUALS.find((visual) =>
visual.keywords.some((keyword) => title.includes(normalizeTitle(keyword))),