mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix(route): Epic Games Store - item added bundles link (#9826)
* fix(route): Epic Games Store * fix(route): Epic Games Store - item added bundles link
This commit is contained in:
+19
-12
@@ -27,18 +27,25 @@ module.exports = async (ctx) => {
|
||||
dayjs(item.promotions.promotionalOffers[0].promotionalOffers[0].startDate) <= now &&
|
||||
dayjs(item.promotions.promotionalOffers[0].promotionalOffers[0].endDate) > now
|
||||
)
|
||||
.map((item) => ({
|
||||
title: item.title,
|
||||
author: item.seller.name,
|
||||
link: `${rootUrl}/${locale}/p/${
|
||||
item.catalogNs.mappings.length > 0 ? item.catalogNs.mappings[0].pageSlug : item.offerMappings.length > 0 ? item.offerMappings[0].pageSlug : item.productSlug ? item.productSlug : item.urlSlug
|
||||
}`,
|
||||
description: art(path.join(__dirname, 'templates/description.art'), {
|
||||
description: item.description,
|
||||
image: item.keyImages[0].url,
|
||||
}),
|
||||
pubDate: parseDate(item.promotions.promotionalOffers[0].promotionalOffers[0].startDate),
|
||||
}));
|
||||
.map((item) => {
|
||||
let link = `${rootUrl}/${locale}/p/`;
|
||||
item.categories.forEach((category) => {
|
||||
if (category.path === 'bundles') {
|
||||
link = `${rootUrl}/${locale}/bundles/`;
|
||||
}
|
||||
});
|
||||
link += item.catalogNs.mappings.length > 0 ? item.catalogNs.mappings[0].pageSlug : item.offerMappings.length > 0 ? item.offerMappings[0].pageSlug : item.productSlug ? item.productSlug : item.urlSlug;
|
||||
return {
|
||||
title: item.title,
|
||||
author: item.seller.name,
|
||||
link,
|
||||
description: art(path.join(__dirname, 'templates/description.art'), {
|
||||
description: item.description,
|
||||
image: item.keyImages[0].url,
|
||||
}),
|
||||
pubDate: parseDate(item.promotions.promotionalOffers[0].promotionalOffers[0].startDate),
|
||||
};
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'Epic Games Store - Free Games',
|
||||
|
||||
Reference in New Issue
Block a user