1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Highlight categories with unread entries

This commit is contained in:
Romain de Laage 2022-07-20 18:24:33 +02:00 committed by Frédéric Guillot
parent d7cf782019
commit 3ac5095776
6 changed files with 24 additions and 3 deletions

View file

@ -122,11 +122,13 @@ func (s *Storage) CategoriesWithFeedCount(userID int64) (model.Categories, error
(SELECT count(*)
FROM feeds
JOIN entries ON (feeds.id = entries.feed_id)
WHERE feeds.category_id = c.id AND entries.status = 'unread')
WHERE feeds.category_id = c.id AND entries.status = 'unread') AS count_unread
FROM categories c
WHERE
user_id=$1
ORDER BY c.title ASC
ORDER BY
count_unread DESC,
c.title ASC
`
rows, err := s.db.Query(query, userID)