Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/11569#issuecomment-3830365450

Danielf971b4b893ea
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 7a7e7ffcac..ebf46513b1 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -175,6 +175,16 @@ func UnusedAttributeViews() (ret []*UnusedItem) {
ret = append(ret, &UnusedItem{Item: id, Name: name})
}
}
+
+ // 按文件更新时间排序
+ sort.Slice(ret, func(i, j int) bool {
+ iInfo, iErr := os.Stat(filepath.Join(util.DataDir, "storage", "av", ret[i].Item+".json"))
+ jInfo, jErr := os.Stat(filepath.Join(util.DataDir, "storage", "av", ret[j].Item+".json"))
+ if iErr != nil || jErr != nil {
+ return iInfo.ModTime().After(jInfo.ModTime())
+ }
+ return ret[i].Item > ret[j].Item
+ })
return
}