🎨 Export related flashcard data when exporting .sy.zip https://github.com/siyuan-note/siyuan/issues/9372

This commit is contained in:
Daniel 2023-10-08 16:35:06 +08:00
parent 2ca7253d1f
commit a8806968d0
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 72 additions and 2 deletions

View file

@ -226,6 +226,21 @@ func GetBlockTreesByPathPrefix(pathPrefix string) (ret []*BlockTree) {
return
}
func GetBlockTreesByRootID(rootID string) (ret []*BlockTree) {
blockTrees.Range(func(key, value interface{}) bool {
slice := value.(*btSlice)
slice.m.Lock()
for _, b := range slice.data {
if b.RootID == rootID {
ret = append(ret, b)
}
}
slice.m.Unlock()
return true
})
return
}
func RemoveBlockTreesByPathPrefix(pathPrefix string) {
var ids []string
blockTrees.Range(func(key, value interface{}) bool {