mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Add global block and keep filters
This commit is contained in:
parent
c4278821cb
commit
1a81866bb9
30 changed files with 457 additions and 50 deletions
|
@ -92,7 +92,9 @@ func (s *Storage) CreateUser(userCreationRequest *model.UserCreationRequest) (*m
|
|||
default_home_page,
|
||||
categories_sorting_order,
|
||||
mark_read_on_view,
|
||||
media_playback_rate
|
||||
media_playback_rate,
|
||||
block_filter_entry_rules,
|
||||
keep_filter_entry_rules
|
||||
`
|
||||
|
||||
tx, err := s.db.Begin()
|
||||
|
@ -132,6 +134,8 @@ func (s *Storage) CreateUser(userCreationRequest *model.UserCreationRequest) (*m
|
|||
&user.CategoriesSortingOrder,
|
||||
&user.MarkReadOnView,
|
||||
&user.MediaPlaybackRate,
|
||||
&user.BlockFilterEntryRules,
|
||||
&user.KeepFilterEntryRules,
|
||||
)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
|
@ -189,9 +193,11 @@ func (s *Storage) UpdateUser(user *model.User) error {
|
|||
default_home_page=$20,
|
||||
categories_sorting_order=$21,
|
||||
mark_read_on_view=$22,
|
||||
media_playback_rate=$23
|
||||
media_playback_rate=$23,
|
||||
block_filter_entry_rules=$24,
|
||||
keep_filter_entry_rules=$25
|
||||
WHERE
|
||||
id=$24
|
||||
id=$26
|
||||
`
|
||||
|
||||
_, err = s.db.Exec(
|
||||
|
@ -219,6 +225,8 @@ func (s *Storage) UpdateUser(user *model.User) error {
|
|||
user.CategoriesSortingOrder,
|
||||
user.MarkReadOnView,
|
||||
user.MediaPlaybackRate,
|
||||
user.BlockFilterEntryRules,
|
||||
user.KeepFilterEntryRules,
|
||||
user.ID,
|
||||
)
|
||||
if err != nil {
|
||||
|
@ -248,9 +256,11 @@ func (s *Storage) UpdateUser(user *model.User) error {
|
|||
default_home_page=$19,
|
||||
categories_sorting_order=$20,
|
||||
mark_read_on_view=$21,
|
||||
media_playback_rate=$22
|
||||
media_playback_rate=$22,
|
||||
block_filter_entry_rules=$23,
|
||||
keep_filter_entry_rules=$24
|
||||
WHERE
|
||||
id=$23
|
||||
id=$25
|
||||
`
|
||||
|
||||
_, err := s.db.Exec(
|
||||
|
@ -277,6 +287,8 @@ func (s *Storage) UpdateUser(user *model.User) error {
|
|||
user.CategoriesSortingOrder,
|
||||
user.MarkReadOnView,
|
||||
user.MediaPlaybackRate,
|
||||
user.BlockFilterEntryRules,
|
||||
user.KeepFilterEntryRules,
|
||||
user.ID,
|
||||
)
|
||||
|
||||
|
@ -325,7 +337,9 @@ func (s *Storage) UserByID(userID int64) (*model.User, error) {
|
|||
default_home_page,
|
||||
categories_sorting_order,
|
||||
mark_read_on_view,
|
||||
media_playback_rate
|
||||
media_playback_rate,
|
||||
block_filter_entry_rules,
|
||||
keep_filter_entry_rules
|
||||
FROM
|
||||
users
|
||||
WHERE
|
||||
|
@ -361,7 +375,9 @@ func (s *Storage) UserByUsername(username string) (*model.User, error) {
|
|||
default_home_page,
|
||||
categories_sorting_order,
|
||||
mark_read_on_view,
|
||||
media_playback_rate
|
||||
media_playback_rate,
|
||||
block_filter_entry_rules,
|
||||
keep_filter_entry_rules
|
||||
FROM
|
||||
users
|
||||
WHERE
|
||||
|
@ -397,7 +413,9 @@ func (s *Storage) UserByField(field, value string) (*model.User, error) {
|
|||
default_home_page,
|
||||
categories_sorting_order,
|
||||
mark_read_on_view,
|
||||
media_playback_rate
|
||||
media_playback_rate,
|
||||
block_filter_entry_rules,
|
||||
keep_filter_entry_rules
|
||||
FROM
|
||||
users
|
||||
WHERE
|
||||
|
@ -440,7 +458,9 @@ func (s *Storage) UserByAPIKey(token string) (*model.User, error) {
|
|||
u.default_home_page,
|
||||
u.categories_sorting_order,
|
||||
u.mark_read_on_view,
|
||||
media_playback_rate
|
||||
media_playback_rate,
|
||||
u.block_filter_entry_rules,
|
||||
u.keep_filter_entry_rules
|
||||
FROM
|
||||
users u
|
||||
LEFT JOIN
|
||||
|
@ -478,6 +498,8 @@ func (s *Storage) fetchUser(query string, args ...interface{}) (*model.User, err
|
|||
&user.CategoriesSortingOrder,
|
||||
&user.MarkReadOnView,
|
||||
&user.MediaPlaybackRate,
|
||||
&user.BlockFilterEntryRules,
|
||||
&user.KeepFilterEntryRules,
|
||||
)
|
||||
|
||||
if err == sql.ErrNoRows {
|
||||
|
@ -586,7 +608,9 @@ func (s *Storage) Users() (model.Users, error) {
|
|||
default_home_page,
|
||||
categories_sorting_order,
|
||||
mark_read_on_view,
|
||||
media_playback_rate
|
||||
media_playback_rate,
|
||||
block_filter_entry_rules,
|
||||
keep_filter_entry_rules
|
||||
FROM
|
||||
users
|
||||
ORDER BY username ASC
|
||||
|
@ -625,6 +649,8 @@ func (s *Storage) Users() (model.Users, error) {
|
|||
&user.CategoriesSortingOrder,
|
||||
&user.MarkReadOnView,
|
||||
&user.MediaPlaybackRate,
|
||||
&user.BlockFilterEntryRules,
|
||||
&user.KeepFilterEntryRules,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue