From 4366aa79240e5dab4a4da2af146644fd90c8c038 Mon Sep 17 00:00:00 2001 From: NicoVIII Date: Sun, 30 Aug 2026 11:22:19 +0000 Subject: [PATCH] Fix steam metadata import if full_description is missing When trying to import a game which is restricted in your country, steam seems to not provide a full_description. This caused errors while importing, because the undefined was unexpected here. I made this case explicit and the code a bit more typesafe to fix this error and at least allows to import the metadata you have access to via steam. Fixes #403. --- server/server/internal/metadata/steam.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/server/internal/metadata/steam.ts b/server/server/internal/metadata/steam.ts index d180f894..11013899 100644 --- a/server/server/internal/metadata/steam.ts +++ b/server/server/internal/metadata/steam.ts @@ -129,7 +129,8 @@ interface SteamAppDetailsLarge extends SteamAppDetailsSmall { ordinal: number; }[]; }; - full_description: string; + // Can be undefined if the game is not available in the country of the request + full_description: string | undefined; } interface SteamAppDetailsPackage { @@ -418,7 +419,7 @@ export class SteamProvider implements MetadataProvider { ); } else { context?.logger.info("Using fallback description from basic game info"); - description = currentGame.full_description; + description = currentGame.full_description ?? ""; } context?.progress(90); @@ -485,7 +486,7 @@ export class SteamProvider implements MetadataProvider { bannerId: banner, coverId: cover, images, - } as GameMetadata; + } satisfies GameMetadata; } async fetchCompany({