Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: OCR 未启用时不保存 ocr-texts.json https://github.com/siyuan-note/siyuan/issues/11171

Daniele050f760deaa
diff --git a/kernel/util/ocr.go b/kernel/util/ocr.go
index b9598a7bcb..8d280cc4ee 100644
--- a/kernel/util/ocr.go
+++ b/kernel/util/ocr.go
@@ -132,10 +132,12 @@ func SaveAssetsTexts() {
}
func SetAssetText(asset, text string) {
+ var oldText string
assetsTextsLock.Lock()
+ oldText = assetsTexts[asset]
assetsTexts[asset] = text
assetsTextsLock.Unlock()
- if "" != text {
+ if oldText != text {
assetsTextsChanged.Store(true)
}
}