Merge pull request #3317 from LooseLi/fix-fileUrl

fix: enable all Notion file types to work properly
This commit is contained in:
tangly1024
2025-04-11 17:53:36 +08:00
committed by GitHub

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}`