diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc.sy index aafa09f66..8fa991528 100644 --- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc.sy +++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc.sy @@ -6,7 +6,7 @@ "icon": "1f387", "id": "20230805231816-h1z9mpc", "title": "Function Features", - "updated": "20230805232135" + "updated": "20230903112409" }, "Children": [ { diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc/20230805232134-3d6mx2k.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc/20230805232134-3d6mx2k.sy index 4b7e34767..7553696b4 100644 --- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc/20230805232134-3d6mx2k.sy +++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20230805231614-vqn28eh/20230805231816-h1z9mpc/20230805232134-3d6mx2k.sy @@ -5,7 +5,7 @@ "Properties": { "id": "20230805232134-3d6mx2k", "title": "Search asset content", - "updated": "20230821123134" + "updated": "20230903112423" }, "Children": [ { @@ -185,6 +185,68 @@ ] } ] + }, + { + "ID": "20230903112419-oart7ii", + "Type": "NodeParagraph", + "Properties": { + "id": "20230903112419-oart7ii", + "updated": "20230903112419" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "​" + }, + { + "Type": "NodeTextMark", + "TextMarkType": "tag", + "TextMarkTextContent": "Note" + }, + { + "Type": "NodeText", + "Data": "​:" + } + ] + }, + { + "ID": "20230903112419-45ps71g", + "Type": "NodeList", + "ListData": {}, + "Properties": { + "id": "20230903112419-45ps71g", + "updated": "20230903112423" + }, + "Children": [ + { + "ID": "20230903112419-t7iom3o", + "Type": "NodeListItem", + "ListData": { + "BulletChar": 42, + "Marker": "Kg==" + }, + "Properties": { + "id": "20230903112419-t7iom3o", + "updated": "20230903112423" + }, + "Children": [ + { + "ID": "20230903112419-8gd73ed", + "Type": "NodeParagraph", + "Properties": { + "id": "20230903112419-8gd73ed", + "updated": "20230903112423" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "Android/iOS does not support PDF asset content search" + } + ] + } + ] + } + ] } ] } \ No newline at end of file diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20230805222417-2lj3dvk/20230805225107-qm1m2f5/20230805230218-aea8icj.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20230805222417-2lj3dvk/20230805225107-qm1m2f5/20230805230218-aea8icj.sy index ab520a360..14790bb10 100644 --- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20230805222417-2lj3dvk/20230805225107-qm1m2f5/20230805230218-aea8icj.sy +++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20230805222417-2lj3dvk/20230805225107-qm1m2f5/20230805230218-aea8icj.sy @@ -5,7 +5,7 @@ "Properties": { "id": "20230805230218-aea8icj", "title": "搜索资源文件内容", - "updated": "20230821123142" + "updated": "20230903112313" }, "Children": [ { @@ -187,6 +187,68 @@ ] } ] + }, + { + "ID": "20230903112236-sl6rni1", + "Type": "NodeParagraph", + "Properties": { + "id": "20230903112236-sl6rni1", + "updated": "20230903112241" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "​" + }, + { + "Type": "NodeTextMark", + "TextMarkType": "tag", + "TextMarkTextContent": "注意" + }, + { + "Type": "NodeText", + "Data": "​:" + } + ] + }, + { + "ID": "20230903112243-pwm33kc", + "Type": "NodeList", + "ListData": {}, + "Properties": { + "id": "20230903112243-pwm33kc", + "updated": "20230903112313" + }, + "Children": [ + { + "ID": "20230903112244-2ye7sed", + "Type": "NodeListItem", + "ListData": { + "BulletChar": 42, + "Marker": "Kg==" + }, + "Properties": { + "id": "20230903112244-2ye7sed", + "updated": "20230903112313" + }, + "Children": [ + { + "ID": "20230903112244-ux44rel", + "Type": "NodeParagraph", + "Properties": { + "id": "20230903112244-ux44rel", + "updated": "20230903112313" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "Android/iOS 端不支持 PDF 资源文件内容搜索" + } + ] + } + ] + } + ] } ] } \ No newline at end of file diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx.sy index 6719e7504..fcd82c8db 100644 --- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx.sy +++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx.sy @@ -6,7 +6,7 @@ "icon": "1f387", "id": "20230805232719-04mqbcx", "title": "功能特性", - "updated": "20230805232932" + "updated": "20230805232858" }, "Children": [ { diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx/20230805232920-5fdco36.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx/20230805232920-5fdco36.sy index 3115e6217..ddd1d06bd 100644 --- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx/20230805232920-5fdco36.sy +++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20230805232636-zh0adz2/20230805232719-04mqbcx/20230805232920-5fdco36.sy @@ -5,7 +5,7 @@ "Properties": { "id": "20230805232920-5fdco36", "title": "搜索資源文件內容", - "updated": "20230821123201" + "updated": "20230903112449" }, "Children": [ { @@ -190,6 +190,68 @@ ] } ] + }, + { + "ID": "20230903112449-zvenj8x", + "Type": "NodeParagraph", + "Properties": { + "id": "20230903112449-zvenj8x", + "updated": "20230903112449" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "​" + }, + { + "Type": "NodeTextMark", + "TextMarkType": "tag", + "TextMarkTextContent": "注意" + }, + { + "Type": "NodeText", + "Data": "​:" + } + ] + }, + { + "ID": "20230903112449-mq7jbfe", + "Type": "NodeList", + "ListData": {}, + "Properties": { + "id": "20230903112449-mq7jbfe", + "updated": "20230903112449" + }, + "Children": [ + { + "ID": "20230903112449-ihee8jo", + "Type": "NodeListItem", + "ListData": { + "BulletChar": 42, + "Marker": "Kg==" + }, + "Properties": { + "id": "20230903112449-ihee8jo", + "updated": "20230903112449" + }, + "Children": [ + { + "ID": "20230903112449-v6wir40", + "Type": "NodeParagraph", + "Properties": { + "id": "20230903112449-v6wir40", + "updated": "20230903112449" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "Android/iOS 端不支持 PDF 資源文件內容搜索" + } + ] + } + ] + } + ] } ] } \ No newline at end of file diff --git a/kernel/model/asset_content.go b/kernel/model/asset_content.go index 9b8edbf03..b1b931545 100644 --- a/kernel/model/asset_content.go +++ b/kernel/model/asset_content.go @@ -553,7 +553,8 @@ func copyTempAsset(absPath string) (ret string) { filelock.RWLock.Lock() defer filelock.RWLock.Unlock() - ret = filepath.Join(dir, gulu.Rand.String(7)+".docx") + ext := filepath.Ext(absPath) + ret = filepath.Join(dir, gulu.Rand.String(7)+ext) if err := gulu.File.Copy(absPath, ret); nil != err { logging.LogErrorf("copy [src=%s, dest=%s] failed: %s", absPath, ret, err) return @@ -751,6 +752,11 @@ func (parser *PdfAssetParser) getTextPageWorker(id int, instance pdfium.Pdfium, // Parse will parse a PDF document using PDFium webassembly module using a worker pool func (parser *PdfAssetParser) Parse(absPath string) (ret *AssetParseResult) { + if util.ContainerIOS == util.Container || util.ContainerAndroid == util.Container { + // PDF asset content searching is not supported on mobile platforms + return + } + now := time.Now() if !strings.HasSuffix(strings.ToLower(absPath), ".pdf") { return @@ -778,9 +784,6 @@ func (parser *PdfAssetParser) Parse(absPath string) (ret *AssetParseResult) { cores := runtime.NumCPU() if 4 < cores { cores = 4 // Limit memory usage - if util.ContainerIOS == util.Container || util.ContainerAndroid == util.Container { - cores = 1 // Reduce the memory usage of PDF asset file content parsing on the mobile https://github.com/siyuan-note/siyuan/issues/9079 - } } pool, err := webassembly.Init(webassembly.Config{