diff --git a/lib/v2/gamme/category.js b/lib/v2/gamme/category.js index 50e762fb03..88f1336f30 100644 --- a/lib/v2/gamme/category.js +++ b/lib/v2/gamme/category.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const baseUrl = `https://${domain}.gamme.com.tw`; const feed = await parser.parseURL(`${baseUrl + (category ? `/category/${category}` : '')}/feed`); - await Promise.all( + const items = await Promise.all( feed.items.map((item) => ctx.cache.tryGet(item.link, async () => { const { data } = await got(item.link); @@ -45,6 +45,6 @@ module.exports = async (ctx) => { link: feed.link, image: domain === 'news' ? `${baseUrl}/blogico.ico` : `${baseUrl}/favicon.ico`, description: feed.description, - item: feed.items, + item: items, }; }; diff --git a/lib/v2/gamme/tag.js b/lib/v2/gamme/tag.js index eaf7134ba8..df9ddc0b39 100644 --- a/lib/v2/gamme/tag.js +++ b/lib/v2/gamme/tag.js @@ -14,7 +14,7 @@ module.exports = async (ctx) => { const { data } = await got(pageUrl); const $ = cheerio.load(data); - const items = $('#category_new li a, .List-4 h3 a') + const list = $('#category_new li a, .List-4 h3 a') .toArray() .map((item) => { item = $(item); @@ -24,8 +24,8 @@ module.exports = async (ctx) => { }; }); - await Promise.all( - items.map((item) => + const items = await Promise.all( + list.map((item) => ctx.cache.tryGet(item.link, async () => { const { data } = await got(item.link); const $ = cheerio.load(data);