mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Use vanilla HTTP handlers (refactoring)
This commit is contained in:
parent
1eba1730d1
commit
f49b42f70f
121 changed files with 4339 additions and 3369 deletions
|
@ -16,6 +16,20 @@ import (
|
|||
"github.com/lib/pq"
|
||||
)
|
||||
|
||||
// CountUnreadEntries returns the number of unread entries.
|
||||
func (s *Storage) CountUnreadEntries(userID int64) int {
|
||||
builder := s.NewEntryQueryBuilder(userID)
|
||||
builder.WithStatus(model.EntryStatusUnread)
|
||||
|
||||
n, err := builder.CountEntries()
|
||||
if err != nil {
|
||||
logger.Error("unable to count unread entries: %v", err)
|
||||
return 0
|
||||
}
|
||||
|
||||
return n
|
||||
}
|
||||
|
||||
// NewEntryQueryBuilder returns a new EntryQueryBuilder
|
||||
func (s *Storage) NewEntryQueryBuilder(userID int64) *EntryQueryBuilder {
|
||||
return NewEntryQueryBuilder(s, userID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue