feat: add race cover image extraction
Some checks failed
CI / build-and-test (pull_request) Has been cancelled
Some checks failed
CI / build-and-test (pull_request) Has been cancelled
This commit is contained in:
@@ -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))),
|
||||
|
||||
Reference in New Issue
Block a user