mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 00:04:21 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e385f9cc53
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue