fix: enable all Notion file types to work properly

This commit is contained in:
LooseLi
2025-04-07 15:49:27 +08:00
parent 61bdfef701
commit 86a1eddb92

View File

@@ -1,5 +1,9 @@
import BLOG from '@/blog.config'
import { getDataFromCache, getOrSetDataWithCache, setDataToCache } from '@/lib/cache/cache_manager'
import {
getDataFromCache,
getOrSetDataWithCache,
setDataToCache
} from '@/lib/cache/cache_manager'
import { deepClone, delay } from '../utils'
import notionAPI from '@/lib/notion/getNotionAPI'
@@ -139,8 +143,7 @@ function convertNotionBlocksToPost(id, blockMap, slice) {
b?.value?.type === 'pdf' ||
b?.value?.type === 'video' ||
b?.value?.type === 'audio') &&
b?.value?.properties?.source?.[0][0] &&
b?.value?.properties?.source?.[0][0].indexOf('amazonaws.com') > 0
b?.value?.properties?.source?.[0][0]
) {
const oldUrl = b?.value?.properties?.source?.[0][0]
const newUrl = `https://notion.so/signed/${encodeURIComponent(oldUrl)}?table=block&id=${b?.value?.id}`