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:
parent
571d7bf17c
commit
0bcfc81b1f
24 changed files with 109 additions and 30 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue