mirror of
https://github.com/miniflux/v2.git
synced 2024-09-27 21:02:41 +02:00
Order disabled feeds at the end of the list
This commit is contained in:
parent
b21f12015e
commit
c1c3624593
@ -21,17 +21,17 @@ type byStateAndName struct{ f model.Feeds }
|
|||||||
func (l byStateAndName) Len() int { return len(l.f) }
|
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) Swap(i, j int) { l.f[i], l.f[j] = l.f[j], l.f[i] }
|
||||||
func (l byStateAndName) Less(i, j int) bool {
|
func (l byStateAndName) Less(i, j int) bool {
|
||||||
if l.f[i].ParsingErrorCount > 0 && l.f[j].ParsingErrorCount == 0 {
|
// disabled test first, since we don't care about errors if disabled
|
||||||
return true
|
if l.f[i].Disabled != l.f[j].Disabled {
|
||||||
} else if l.f[i].ParsingErrorCount == 0 && l.f[j].ParsingErrorCount > 0 {
|
return l.f[j].Disabled
|
||||||
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
|
|
||||||
} else {
|
|
||||||
return l.f[i].Title < l.f[j].Title
|
|
||||||
}
|
}
|
||||||
|
if l.f[i].ParsingErrorCount != l.f[j].ParsingErrorCount {
|
||||||
|
return l.f[i].ParsingErrorCount > l.f[j].ParsingErrorCount
|
||||||
|
}
|
||||||
|
if l.f[i].UnreadCount != l.f[j].UnreadCount {
|
||||||
|
return l.f[i].UnreadCount > l.f[j].UnreadCount
|
||||||
|
}
|
||||||
|
return l.f[i].Title < l.f[j].Title
|
||||||
}
|
}
|
||||||
|
|
||||||
// FeedExists checks if the given feed exists.
|
// FeedExists checks if the given feed exists.
|
||||||
|
Loading…
Reference in New Issue
Block a user