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') {