mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Update entry processor to allow blocking/keeping entries by tags
This commit is contained in:
parent
6fc4e2f45e
commit
1441dc7600
2 changed files with 26 additions and 2 deletions
|
@ -115,7 +115,15 @@ func ProcessFeedEntries(store *storage.Storage, feed *model.Feed, user *model.Us
|
|||
|
||||
func isBlockedEntry(feed *model.Feed, entry *model.Entry) bool {
|
||||
if feed.BlocklistRules != "" {
|
||||
if matchField(feed.BlocklistRules, entry.URL) || matchField(feed.BlocklistRules, entry.Title) {
|
||||
var containsBlockedTag bool = false
|
||||
for _, tag := range entry.Tags {
|
||||
if matchField(feed.BlocklistRules, tag) {
|
||||
containsBlockedTag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if matchField(feed.BlocklistRules, entry.URL) || matchField(feed.BlocklistRules, entry.Title) || containsBlockedTag {
|
||||
slog.Debug("Blocking entry based on rule",
|
||||
slog.Int64("entry_id", entry.ID),
|
||||
slog.String("entry_url", entry.URL),
|
||||
|
@ -132,7 +140,15 @@ func isBlockedEntry(feed *model.Feed, entry *model.Entry) bool {
|
|||
|
||||
func isAllowedEntry(feed *model.Feed, entry *model.Entry) bool {
|
||||
if feed.KeeplistRules != "" {
|
||||
if matchField(feed.KeeplistRules, entry.URL) || matchField(feed.KeeplistRules, entry.Title) {
|
||||
var containsAllowedTag bool = false
|
||||
for _, tag := range entry.Tags {
|
||||
if matchField(feed.KeeplistRules, tag) {
|
||||
containsAllowedTag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if matchField(feed.KeeplistRules, entry.URL) || matchField(feed.KeeplistRules, entry.Title) || containsAllowedTag {
|
||||
slog.Debug("Allow entry based on rule",
|
||||
slog.Int64("entry_id", entry.ID),
|
||||
slog.String("entry_url", entry.URL),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue