mirror of
https://github.com/miniflux/v2.git
synced 2025-07-02 16:38:37 +00:00
Mark only globally visible entries when marking all entries from UI
This commit is contained in:
parent
31c4172540
commit
118e18190d
2 changed files with 28 additions and 1 deletions
|
@ -449,6 +449,33 @@ func (s *Storage) MarkAllAsRead(userID int64) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// MarkGloballyVisibleFeedsAsRead updates all user entries to the read status.
|
||||
func (s *Storage) MarkGloballyVisibleFeedsAsRead(userID int64) error {
|
||||
query := `
|
||||
UPDATE
|
||||
entries
|
||||
SET
|
||||
status=$1,
|
||||
changed_at=now()
|
||||
FROM
|
||||
feeds
|
||||
WHERE
|
||||
entries.feed_id = feeds.id
|
||||
AND entries.user_id=$2
|
||||
AND entries.status=$3
|
||||
AND feeds.hide_globally=$4
|
||||
`
|
||||
result, err := s.db.Exec(query, model.EntryStatusRead, userID, model.EntryStatusUnread, false)
|
||||
if err != nil {
|
||||
return fmt.Errorf(`store: unable to mark globally visible feeds as read: %v`, err)
|
||||
}
|
||||
|
||||
count, _ := result.RowsAffected()
|
||||
logger.Debug("[Storage:MarkGloballyVisibleFeedsAsRead] %d items marked as read", count)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarkFeedAsRead updates all feed entries to the read status.
|
||||
func (s *Storage) MarkFeedAsRead(userID, feedID int64, before time.Time) error {
|
||||
query := `
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue