diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-26 00:23:49 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-26 00:23:49 +0200 |
commit | a83e9bd36fc6a934553d93cbcc0edb120321f971 (patch) | |
tree | a9cc04ca3a0f8392f6ccbf470b323794e535ae7a /internal/feed/feed.go | |
parent | 87fd0ad3e9309064fe9fda373035f5ce127ae8d8 (diff) | |
download | feed2imap-go-a83e9bd36fc6a934553d93cbcc0edb120321f971.tar.gz feed2imap-go-a83e9bd36fc6a934553d93cbcc0edb120321f971.tar.bz2 feed2imap-go-a83e9bd36fc6a934553d93cbcc0edb120321f971.zip |
Filtering from cache
Diffstat (limited to '')
-rw-r--r-- | internal/feed/feed.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go index 6b95f6e..433d080 100644 --- a/internal/feed/feed.go +++ b/internal/feed/feed.go @@ -24,6 +24,8 @@ type feedDescriptor struct { type feeditem struct { *gofeed.Feed *gofeed.Item + updateOnly bool + reasons []string } func (item feeditem) Creator() string { @@ -33,6 +35,10 @@ func (item feeditem) Creator() string { return "" } +func (item feeditem) addReason(reason string) { + item.reasons = append(item.reasons, reason) +} + func (feed *Feed) descriptor() feedDescriptor { return feedDescriptor{ Name: feed.Name, @@ -51,6 +57,12 @@ func (feed *Feed) NeedsUpdate(updateTime time.Time) bool { return true } -func (feed *Feed) Success() bool { +func (feed *Feed) FetchSuccessful() bool { return feed.feed != nil } + +func (feed *Feed) MarkSuccess() { + if feed.cached != nil { + feed.cached.Commit() + } +} |