mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-18 13:08:06 +01:00
🎨 数据同步后需要重新加载图片 OCR 提取结果 Fix https://github.com/siyuan-note/siyuan/issues/7114
This commit is contained in:
parent
9c626ebc0b
commit
175a938eec
7 changed files with 21 additions and 9 deletions
|
|
@ -989,13 +989,17 @@ func syncRepo(exit, byHand bool) (err error) {
|
|||
// 有数据变更,需要重建索引
|
||||
var upserts, removes []string
|
||||
var upsertTrees int
|
||||
var needReloadFlashcard bool
|
||||
var needReloadFlashcard, needReloadOcrTexts bool
|
||||
for _, file := range mergeResult.Upserts {
|
||||
upserts = append(upserts, file.Path)
|
||||
if strings.HasPrefix(file.Path, "/storage/riff/") {
|
||||
needReloadFlashcard = true
|
||||
}
|
||||
|
||||
if strings.HasPrefix(file.Path, "/data/assets/ocr-texts.json") {
|
||||
needReloadOcrTexts = true
|
||||
}
|
||||
|
||||
if strings.HasSuffix(file.Path, ".sy") {
|
||||
upsertTrees++
|
||||
}
|
||||
|
|
@ -1005,10 +1009,18 @@ func syncRepo(exit, byHand bool) (err error) {
|
|||
if strings.HasPrefix(file.Path, "/storage/riff/") {
|
||||
needReloadFlashcard = true
|
||||
}
|
||||
|
||||
if strings.HasPrefix(file.Path, "/data/assets/ocr-texts.json") {
|
||||
needReloadOcrTexts = true
|
||||
}
|
||||
}
|
||||
|
||||
if needReloadFlashcard {
|
||||
InitFlashcards()
|
||||
LoadFlashcards()
|
||||
}
|
||||
|
||||
if needReloadOcrTexts {
|
||||
LoadAssetsTexts()
|
||||
}
|
||||
|
||||
cache.ClearDocsIAL() // 同步后文档树文档图标没有更新 https://github.com/siyuan-note/siyuan/issues/4939
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue