From c335133e69706632be285fc921e9cdd000b8eb5d Mon Sep 17 00:00:00 2001 From: siddharth ravikumar Date: Sat, 11 Apr 2026 11:32:59 -0400 Subject: feed: update Feed Add `IgnoreTitles`. --- feed/feed.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'feed') diff --git a/feed/feed.go b/feed/feed.go index cc7ffc6..a618f05 100644 --- a/feed/feed.go +++ b/feed/feed.go @@ -11,6 +11,7 @@ import ( "os" "os/exec" "path" + "slices" "strings" "time" @@ -24,8 +25,9 @@ type Feed struct { Source string Schema string Last int - TitleContains string `json:"title-contains"` - IgnoreShorts bool `json:"ignore-shorts"` + TitleContains string `json:"title-contains"` + IgnoreShorts bool `json:"ignore-shorts"` + IgnoreTitles []string `json:"ignore-titles"` YDLPath string DumpDir string Entries []schema.Entry @@ -178,6 +180,20 @@ func (feed *Feed) Process(pState *state.ProcessState) { continue } + if len(feed.IgnoreTitles) > 0 { + // Ignore entry if its title matches any of + // the feed's 'ignore-titles' strings. + var ignore bool + if slices.ContainsFunc(feed.IgnoreTitles, e.TitleContains) { + fmt.Printf("[%s][%s]: Skipping '%s'\n", + feed.Id, e.Id, e.Title) + ignore = true + } + if ignore { + continue + } + } + // Process entry only if it was not downloaded before. if !pState.DB.Exists(feed.Id, e.Id) { go feed.processEntry(e, erChan, eSem) -- cgit v1.2.3