summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsiddharth ravikumar <s@ricketyspace.net>2026-04-11 11:32:59 -0400
committersiddharth ravikumar <s@ricketyspace.net>2026-04-11 11:32:59 -0400
commitc335133e69706632be285fc921e9cdd000b8eb5d (patch)
tree1e07f9a0608cc5b179818f29af5854eec851126b
parentc2f37cf8f18153e024df2dbfd1a368c369a82f8a (diff)
feed: update Feed
Add `IgnoreTitles`.
-rw-r--r--feed/feed.go20
-rw-r--r--version/version.go2
2 files changed, 19 insertions, 3 deletions
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)
diff --git a/version/version.go b/version/version.go
index 5e37144..6176aea 100644
--- a/version/version.go
+++ b/version/version.go
@@ -3,4 +3,4 @@
package version
-const Version = "0.8.6"
+const Version = "0.8.7-dev.0"