Show database statstics on the info page.

This commit is contained in:
2022-08-21 09:38:44 +09:30
parent 6f93f2ff50
commit db72e8fb7d
5 changed files with 37 additions and 7 deletions

View File

@@ -32,3 +32,16 @@ func (stats DBStats) String() string {
}
return out
}
func (stats DBStats) MostRecentBookmarkInfo() BookmarkInfo {
mostRecent := time.Time{}
for k := range stats.History {
if k.After(mostRecent) {
mostRecent = k
}
}
if !mostRecent.IsZero() {
return stats.History[mostRecent]
}
return BookmarkInfo{}
}