Rescrape all links if needed on startup

This commit is contained in:
2025-05-02 19:51:41 +09:30
parent ae654998f7
commit 0171be0ee4
3 changed files with 39 additions and 7 deletions

View File

@@ -262,6 +262,17 @@ func (m *BookmarkManager) UpdateContent() {
}
}
// AllBookmarks returns all bookmarks. It does not use the index for this
// operation.
func (m *BookmarkManager) AllBookmarks() ([]entity.Bookmark, error) {
bookmarks := make([]entity.Bookmark, 0)
err := m.db.store.Find(&bookmarks, &bolthold.Query{})
if err != nil {
panic(err)
}
return bookmarks, nil
}
func (m *BookmarkManager) Stats() (entity.DBStats, error) {
stats := entity.DBStats{}
err := m.db.store.Get("stats", &stats)