Skip to content

Commit

Permalink
fix(route): 优化 bilibili 动态路由的 category (#16283)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen authored Jul 28, 2024
1 parent 1174beb commit a1780e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/routes/bilibili/dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ async function handler(ctx) {
}
}
}
if (data.module_dynamic?.topic?.name) {
// 将话题作为 category
category.push(data.module_dynamic.topic.name);
}

if (item.type === 'DYNAMIC_TYPE_ARTICLE' && displayArticle) {
// 抓取专栏全文
Expand Down Expand Up @@ -365,7 +369,7 @@ async function handler(ctx) {
pubDate: data.module_author?.pub_ts ? parseDate(data.module_author.pub_ts, 'X') : undefined,
link,
author,
category: category.length ? category : undefined,
category: category.length ? [...new Set(category)] : undefined,
};
})
);
Expand Down

0 comments on commit a1780e6

Please sign in to comment.