Skip to content

Commit

Permalink
fix(route): gamme (#14108)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL authored Dec 24, 2023
1 parent 30ed60d commit 26d4afc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/v2/gamme/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
};
};
6 changes: 3 additions & 3 deletions lib/v2/gamme/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 26d4afc

Please sign in to comment.