mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Add option to hide feeds from the global Unread list
This commit is contained in:
parent
8bc06a5d65
commit
9965abccfb
23 changed files with 49 additions and 5 deletions
|
@ -357,7 +357,10 @@ func (s *Storage) SetEntriesStatusCount(userID int64, entryIDs []int64, status s
|
|||
FROM entries e
|
||||
JOIN feeds f ON (f.id = e.feed_id)
|
||||
JOIN categories c ON (c.id = f.category_id)
|
||||
WHERE e.user_id = $1 AND e.id = ANY($2) AND NOT c.hide_globally
|
||||
WHERE e.user_id = $1
|
||||
AND e.id = ANY($2)
|
||||
AND NOT f.hide_globally
|
||||
AND NOT c.hide_globally
|
||||
`
|
||||
row := s.db.QueryRow(query, userID, pq.Array(entryIDs))
|
||||
visible := 0
|
||||
|
|
|
@ -183,6 +183,7 @@ func (e *EntryQueryBuilder) WithOffset(offset int) *EntryQueryBuilder {
|
|||
|
||||
func (e *EntryQueryBuilder) WithGloballyVisible() *EntryQueryBuilder {
|
||||
e.conditions = append(e.conditions, "not c.hide_globally")
|
||||
e.conditions = append(e.conditions, "not f.hide_globally")
|
||||
return e
|
||||
}
|
||||
|
||||
|
|
|
@ -233,10 +233,11 @@ func (s *Storage) CreateFeed(feed *model.Feed) error {
|
|||
keeplist_rules,
|
||||
ignore_http_cache,
|
||||
allow_self_signed_certificates,
|
||||
fetch_via_proxy
|
||||
fetch_via_proxy,
|
||||
hide_globally
|
||||
)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20)
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21)
|
||||
RETURNING
|
||||
id
|
||||
`
|
||||
|
@ -262,6 +263,7 @@ func (s *Storage) CreateFeed(feed *model.Feed) error {
|
|||
feed.IgnoreHTTPCache,
|
||||
feed.AllowSelfSignedCertificates,
|
||||
feed.FetchViaProxy,
|
||||
feed.HideGlobally,
|
||||
).Scan(&feed.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf(`store: unable to create feed %q: %v`, feed.FeedURL, err)
|
||||
|
@ -319,9 +321,10 @@ func (s *Storage) UpdateFeed(feed *model.Feed) (err error) {
|
|||
next_check_at=$20,
|
||||
ignore_http_cache=$21,
|
||||
allow_self_signed_certificates=$22,
|
||||
fetch_via_proxy=$23
|
||||
fetch_via_proxy=$23,
|
||||
hide_globally=$24
|
||||
WHERE
|
||||
id=$24 AND user_id=$25
|
||||
id=$25 AND user_id=$26
|
||||
`
|
||||
_, err = s.db.Exec(query,
|
||||
feed.FeedURL,
|
||||
|
@ -347,6 +350,7 @@ func (s *Storage) UpdateFeed(feed *model.Feed) (err error) {
|
|||
feed.IgnoreHTTPCache,
|
||||
feed.AllowSelfSignedCertificates,
|
||||
feed.FetchViaProxy,
|
||||
feed.HideGlobally,
|
||||
feed.ID,
|
||||
feed.UserID,
|
||||
)
|
||||
|
|
|
@ -166,6 +166,7 @@ func (f *FeedQueryBuilder) GetFeeds() (model.Feeds, error) {
|
|||
f.allow_self_signed_certificates,
|
||||
f.fetch_via_proxy,
|
||||
f.disabled,
|
||||
f.hide_globally,
|
||||
f.category_id,
|
||||
c.title as category_title,
|
||||
fi.icon_id,
|
||||
|
@ -226,6 +227,7 @@ func (f *FeedQueryBuilder) GetFeeds() (model.Feeds, error) {
|
|||
&feed.AllowSelfSignedCertificates,
|
||||
&feed.FetchViaProxy,
|
||||
&feed.Disabled,
|
||||
&feed.HideGlobally,
|
||||
&feed.Category.ID,
|
||||
&feed.Category.Title,
|
||||
&iconID,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue