aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/cache_v1.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-26 17:52:55 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-26 17:52:55 +0200
commit63d20f3f7b02f33475049c12e03569a4f67fe810 (patch)
tree42cf1c8bd5d839a410c106c8a1d86b4d4180db37 /internal/feed/cache_v1.go
parent9e69c102b596924d589693ce537c4fecae3aa44c (diff)
downloadfeed2imap-go-63d20f3f7b02f33475049c12e03569a4f67fe810.tar.gz
feed2imap-go-63d20f3f7b02f33475049c12e03569a4f67fe810.tar.bz2
feed2imap-go-63d20f3f7b02f33475049c12e03569a4f67fe810.zip
Options: "disable" and "ignore-hash"
Diffstat (limited to 'internal/feed/cache_v1.go')
-rw-r--r--internal/feed/cache_v1.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/feed/cache_v1.go b/internal/feed/cache_v1.go
index a8e40ed..fb16027 100644
--- a/internal/feed/cache_v1.go
+++ b/internal/feed/cache_v1.go
@@ -171,7 +171,7 @@ func (cf *cachedFeed) deleteItem(index int) {
cf.Items = cf.Items[:len(cf.Items)-1]
}
-func (cf *cachedFeed) filterItems(items []feeditem) []feeditem {
+func (cf *cachedFeed) filterItems(items []feeditem, ignoreHash bool) []feeditem {
if len(items) == 0 {
return items
}
@@ -209,7 +209,7 @@ CACHE_ITEMS:
for idx, oldItem := range cf.Items {
if oldItem.Guid == ci.Guid {
log.Debugf("Guid matches with: %s", oldItem)
- if !oldItem.similarTo(&ci, false) {
+ if !oldItem.similarTo(&ci, ignoreHash) {
item.addReason("guid (upd)")
app(item, ci, &idx)
} else {
@@ -227,7 +227,7 @@ CACHE_ITEMS:
}
for idx, oldItem := range cf.Items {
- if oldItem.similarTo(&ci, false) {
+ if oldItem.similarTo(&ci, ignoreHash) {
log.Debugf("Similarity matches, ignoring: %s", oldItem)
continue CACHE_ITEMS
}