1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-21 18:11:09 +00:00

add option to hide categories from the global unread list

This commit is contained in:
pennae 2021-06-03 02:39:47 +02:00 committed by fguillot
parent 571d7bf17c
commit 0bcfc81b1f
24 changed files with 109 additions and 30 deletions

View file

@ -8,11 +8,12 @@ import "fmt"
// Category represents a feed category.
type Category struct {
ID int64 `json:"id"`
Title string `json:"title"`
UserID int64 `json:"user_id"`
FeedCount int `json:"-"`
TotalUnread int `json:"-"`
ID int64 `json:"id"`
Title string `json:"title"`
UserID int64 `json:"user_id"`
HideGlobally bool `json:"hide_globally"`
FeedCount int `json:"-"`
TotalUnread int `json:"-"`
}
func (c *Category) String() string {
@ -21,12 +22,14 @@ func (c *Category) String() string {
// CategoryRequest represents the request to create or update a category.
type CategoryRequest struct {
Title string `json:"title"`
Title string `json:"title"`
HideGlobally string `json:"hide_globally"`
}
// Patch updates category fields.
func (cr *CategoryRequest) Patch(category *Category) {
category.Title = cr.Title
category.HideGlobally = cr.HideGlobally != ""
}
// Categories represents a list of categories.