A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.
TypeScript amazon-primeelectronepic-games-launcherepic-games-storeepic-storegaminggoggog-galaxyheroic-games-launcherlinuxplay-gamesprotonsteamwine
interface ThumbnailCandidate {
src: string
thumbnail?: string
}
/**
* Picks what a carousel thumbnail should render.
*
* Stores are inconsistent about thumbnails: some send none, some send URLs
* that no longer resolve. In both cases the full screenshot is a better
* fallback than the launcher logo, so only a broken full screenshot ends up
* in the placeholder.
*/
export function resolveThumbnailSource(
image: ThumbnailCandidate,
failedSources: ReadonlySet<string>
): string {
if (image.thumbnail && !failedSources.has(image.thumbnail)) {
return image.thumbnail
}
return image.src
}