From f2f43f7e5bb9459bf8444ee3ffcff63b15b35beb Mon Sep 17 00:00:00 2001 From: KotaHv <92137267+KotaHv@users.noreply.github.com> Date: Thu, 16 May 2024 12:40:25 +0800 Subject: [PATCH] fix(route): Epic Games Store - Resolve issue #15569 (#15602) --- lib/routes/epicgames/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/routes/epicgames/index.ts b/lib/routes/epicgames/index.ts index 22c0bdebe..2fbf1e239 100644 --- a/lib/routes/epicgames/index.ts +++ b/lib/routes/epicgames/index.ts @@ -67,23 +67,25 @@ async function handler(ctx) { isBundles = true; contentUrl = `${contentBaseUrl}/bundles/`; } - const linkSlug = + let linkSlug = item.catalogNs.mappings && item.catalogNs.mappings.length > 0 ? item.catalogNs.mappings[0].pageSlug : item.offerMappings && item.offerMappings.length > 0 ? item.offerMappings[0].pageSlug : item.productSlug ?? item.urlSlug; + if (item.offerType === 'ADD_ON') { + linkSlug = item.offerMappings[0].pageSlug; + } link += linkSlug; contentUrl += linkSlug; let description = item.description; - if (item.offerType !== 'BASE_GAME') { + if (isBundles) { const contentResp = await got({ method: 'get', url: contentUrl, }); - description = isBundles ? contentResp.data.data.about.shortDescription : contentResp.data.pages[0].data.about.shortDescription; + description = contentResp.data.data.about.shortDescription; } - let image = item.keyImages[0].url; item.keyImages.some((keyImage) => { if (keyImage.type === 'DieselStoreFrontWide') {