1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Show count of feeds with permanent errors in header menu

Only for feeds that reach `maxParsingError` are counted (so transient errors do not trigger counter).
This commit is contained in:
Dave Z 2018-08-26 19:18:07 -04:00 committed by Frédéric Guillot
parent aae62aae08
commit 9169fbafb2
42 changed files with 71 additions and 13 deletions

View file

@ -46,6 +46,17 @@ func (s *Storage) CountFeeds(userID int64) int {
return result
}
// CountErrorFeeds returns the number of feeds with parse errors that belong to the given user.
func (s *Storage) CountErrorFeeds(userID int64) int {
var result int
err := s.db.QueryRow(`SELECT count(*) FROM feeds WHERE user_id=$1 AND parsing_error_count>=$2`, userID, maxParsingError).Scan(&result)
if err != nil {
return 0
}
return result
}
// Feeds returns all feeds of the given user.
func (s *Storage) Feeds(userID int64) (model.Feeds, error) {
defer timer.ExecutionTime(time.Now(), fmt.Sprintf("[Storage:Feeds] userID=%d", userID))