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

Add global block and keep filters

This commit is contained in:
privatmamtora 2024-07-03 04:03:49 +00:00 committed by GitHub
parent c4278821cb
commit 1a81866bb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 457 additions and 50 deletions

View file

@ -36,6 +36,8 @@ type User struct {
CategoriesSortingOrder string `json:"categories_sorting_order"`
MarkReadOnView bool `json:"mark_read_on_view"`
MediaPlaybackRate float64 `json:"media_playback_rate"`
BlockFilterEntryRules string `json:"block_filter_entry_rules"`
KeepFilterEntryRules string `json:"keep_filter_entry_rules"`
}
// UserCreationRequest represents the request to create a user.
@ -72,6 +74,8 @@ type UserModificationRequest struct {
CategoriesSortingOrder *string `json:"categories_sorting_order"`
MarkReadOnView *bool `json:"mark_read_on_view"`
MediaPlaybackRate *float64 `json:"media_playback_rate"`
BlockFilterEntryRules *string `json:"block_filter_entry_rules"`
KeepFilterEntryRules *string `json:"keep_filter_entry_rules"`
}
// Patch updates the User object with the modification request.
@ -167,6 +171,14 @@ func (u *UserModificationRequest) Patch(user *User) {
if u.MediaPlaybackRate != nil {
user.MediaPlaybackRate = *u.MediaPlaybackRate
}
if u.BlockFilterEntryRules != nil {
user.BlockFilterEntryRules = *u.BlockFilterEntryRules
}
if u.KeepFilterEntryRules != nil {
user.KeepFilterEntryRules = *u.KeepFilterEntryRules
}
}
// UseTimezone converts last login date to the given timezone.