mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-19 07:26:50 +00:00
fix: 修复部分文章无法加载的问题,原因是Notion API加载时block上限1000
修复思路是在加载所有文章时,会首先一次性加载数据库中所有block,此时因为上限1000会发生溢出。之后会读取所有page的IDs,然后逐个获取page对应的block。此时如果发现ID查找不到(说明发生了溢出),则再调用API去逐一获取这些溢出了的page。可能这不是最优解。 修改的代码包括: 1. getDataBaseInfoByNotionAPI中添加上述判断逻辑。 2. 修改getPageProperties函数签名,直接传入block对应的value,而不是block数组。
This commit is contained in:
@@ -28,7 +28,7 @@ export async function getAllPosts({ notionPageData, from, pageType }) {
|
||||
if (!value) {
|
||||
continue
|
||||
}
|
||||
const properties = (await getPageProperties(id, block, schema, null, tagOptions)) || null
|
||||
const properties = (await getPageProperties(id, block[id].value, schema, null, tagOptions)) || null
|
||||
data.push(properties)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user