summaryrefslogtreecommitdiff
path: root/core/structs.go
diff options
context:
space:
mode:
authornytpu <alex@nytpu.com>2021-04-19 09:48:08 -0600
committernytpu <alex@nytpu.com>2021-04-19 09:48:08 -0600
commitffe7a37c66d5cfe3f834951545c562ae3b8dcdaa (patch)
tree28ed5e673ad78fe4dfb558cce8e2150f7deeb78e /core/structs.go
parent49f93cdf640a9a4c50244a4d6770f908f0c173f8 (diff)
don't include entries older than one year
Diffstat (limited to 'core/structs.go')
-rw-r--r--core/structs.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/structs.go b/core/structs.go
index caab676..b9624a2 100644
--- a/core/structs.go
+++ b/core/structs.go
@@ -82,7 +82,10 @@ func GofeedConvert(f *gofeed.Feed, title string) (*Feed, error) {
}
item.Link = v.Link
- new.Items = append(new.Items, item)
+ // don't insert if older than 1 year
+ if item.Published.After(time.Now().AddDate(-1, 0, 0)) {
+ new.Items = append(new.Items, item)
+ }
}
return new, nil