From e0d0c5c4d58315896041342c2913722b41c895d5 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 22 Nov 2023 21:51:59 +0800 Subject: [PATCH] :art: List file/asset history following the limit of editor history retention days https://github.com/siyuan-note/siyuan/issues/9723 --- kernel/model/history.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/model/history.go b/kernel/model/history.go index cbc6e3416..caba1466b 100644 --- a/kernel/model/history.go +++ b/kernel/model/history.go @@ -394,6 +394,9 @@ func buildSearchHistoryQueryFilter(query, op, box, table string, typ int) (stmt } else if HistoryTypeAsset == typ { stmt += " AND path LIKE '%/assets/%'" } + + ago := time.Now().Add(-24 * time.Hour * time.Duration(Conf.Editor.HistoryRetentionDays)) + stmt += " AND created > '" + fmt.Sprintf("%d", ago.Unix()) + "'" return }