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

Feeds with errors should appear before unread ones

This commit is contained in:
Frédéric Guillot 2021-06-02 18:54:28 -07:00 committed by fguillot
parent 4b2a25eed4
commit 409d05eec8
5 changed files with 27 additions and 10 deletions

View file

@ -21,7 +21,11 @@ type byStateAndName struct{ f model.Feeds }
func (l byStateAndName) Len() int { return len(l.f) }
func (l byStateAndName) Swap(i, j int) { l.f[i], l.f[j] = l.f[j], l.f[i] }
func (l byStateAndName) Less(i, j int) bool {
if l.f[i].UnreadCount > 0 && l.f[j].UnreadCount == 0 {
if l.f[i].ParsingErrorCount > 0 && l.f[j].ParsingErrorCount == 0 {
return true
} else if l.f[i].ParsingErrorCount == 0 && l.f[j].ParsingErrorCount > 0 {
return false
} else if l.f[i].UnreadCount > 0 && l.f[j].UnreadCount == 0 {
return true
} else if l.f[i].UnreadCount == 0 && l.f[j].UnreadCount > 0 {
return false