mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix: 过滤端传媒 API 返回空值 (#5935)
This commit is contained in:
+14
-11
@@ -157,17 +157,20 @@ module.exports = async (ctx) => {
|
||||
};
|
||||
|
||||
const items = await Promise.all(
|
||||
articles.slice(0, token === 'Basic YW5vbnltb3VzOkdpQ2VMRWp4bnFCY1ZwbnA2Y0xzVXZKaWV2dlJRY0FYTHY=' && key.iapReceipt === undefined ? 10 : articles.length).map(async (item) => ({
|
||||
title: item.article.headline,
|
||||
author: item.article.authors.length > 0 ? item.article.authors.map((x) => x.name).toString() : item.article.byline,
|
||||
category: item.article.channels.filter((x) => !x.homepage).map((x) => x.name),
|
||||
description: await getFullText(item.article.slug),
|
||||
link: resolve_url('https://theinitium.com', item.article.url),
|
||||
pubDate: item.article.date,
|
||||
updated: item.article.updated,
|
||||
// 如果遇到编辑部漏录入情况,则给uuid做个手脚,以便阅读器到时重抓。
|
||||
guid: (await getFullText(item.article.slug)).endsWith('内容为空,请稍后再来') ? item.article.uuid + '-I-am-empty' : item.article.uuid,
|
||||
}))
|
||||
articles
|
||||
.filter((a) => a.article)
|
||||
.slice(0, token === 'Basic YW5vbnltb3VzOkdpQ2VMRWp4bnFCY1ZwbnA2Y0xzVXZKaWV2dlJRY0FYTHY=' && key.iapReceipt === undefined ? 10 : articles.length)
|
||||
.map(async (item) => ({
|
||||
title: item.article.headline,
|
||||
author: item.article.authors.length > 0 ? item.article.authors.map((x) => x.name).toString() : item.article.byline,
|
||||
category: item.article.channels.filter((x) => !x.homepage).map((x) => x.name),
|
||||
description: await getFullText(item.article.slug),
|
||||
link: resolve_url('https://theinitium.com', item.article.url),
|
||||
pubDate: item.article.date,
|
||||
updated: item.article.updated,
|
||||
// 如果遇到编辑部漏录入情况,则给uuid做个手脚,以便阅读器到时重抓。
|
||||
guid: (await getFullText(item.article.slug)).endsWith('内容为空,请稍后再来') ? item.article.uuid + '-I-am-empty' : item.article.uuid,
|
||||
}))
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
|
||||
Reference in New Issue
Block a user