Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/notion/getPostBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,10 @@ function convertNotionBlocksToPost(id, blockMap, slice) {

// 如果是文件,或嵌入式PDF,需要重新加密签名
if (
(b?.value?.type === 'file' ||
b?.value?.type === 'pdf' ||
b?.value?.type === 'video' ||
b?.value?.type === 'audio') &&
b?.value?.properties?.source?.[0][0]
['file', 'pdf', 'video', 'audio'].includes(b?.value?.type) &&
b?.value?.properties?.source?.[0][0] &&
(b?.value?.properties?.source?.[0][0].indexOf('attachment') === 0 ||
b?.value?.properties?.source?.[0][0].indexOf('amazonaws.com') > 0)
) {
const oldUrl = b?.value?.properties?.source?.[0][0]
const newUrl = `https://notion.so/signed/${encodeURIComponent(oldUrl)}?table=block&id=${b?.value?.id}`
Expand Down