mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Add API endpoint to fetch unread and read counters
This commit is contained in:
parent
953c1742e0
commit
d118aa8649
7 changed files with 77 additions and 0 deletions
|
@ -158,6 +158,14 @@ func (s *Storage) FeedsWithCounters(userID int64) (model.Feeds, error) {
|
|||
return getFeedsSorted(builder)
|
||||
}
|
||||
|
||||
// Return read and unread count.
|
||||
func (s *Storage) FetchCounters(userID int64) (model.FeedCounters, error) {
|
||||
builder := NewFeedQueryBuilder(s, userID)
|
||||
builder.WithCounters()
|
||||
reads, unreads, err := builder.fetchFeedCounter()
|
||||
return model.FeedCounters{ReadCounters: reads, UnreadCounters: unreads}, err
|
||||
}
|
||||
|
||||
// FeedsByCategoryWithCounters returns all feeds of the given user/category with counters of read and unread entries.
|
||||
func (s *Storage) FeedsByCategoryWithCounters(userID, categoryID int64) (model.Feeds, error) {
|
||||
builder := NewFeedQueryBuilder(s, userID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue