aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/feed/cache_v1.go4
-rw-r--r--internal/feed/state.go5
2 files changed, 7 insertions, 2 deletions
diff --git a/internal/feed/cache_v1.go b/internal/feed/cache_v1.go
index 157741f..02890e1 100644
--- a/internal/feed/cache_v1.go
+++ b/internal/feed/cache_v1.go
@@ -2,6 +2,7 @@ package feed
import (
"crypto/sha256"
+ "encoding/base64"
"encoding/hex"
"fmt"
"strconv"
@@ -207,6 +208,7 @@ func (cf *cachedFeed) filterItems(items []item, ignoreHash, alwaysNew bool) []it
prevId := cf.Items[*oldIdx].ID
ci.ID = prevId
item.itemId = prevId
+ log.Debugf("oldIdx: %d, prevId: %s, item.id: %s", *oldIdx, prevId, item.id())
cf.deleteItem(*oldIdx)
}
filtered = append(filtered, *item)
@@ -225,7 +227,7 @@ CACHE_ITEMS:
item.addReason("guid (upd)")
app(item, ci, &idx)
} else {
- log.Debugf("Similar, ignoring")
+ log.Debugf("Similar, ignoring item %s", base64.RawURLEncoding.EncodeToString(oldItem.ID[:]))
}
continue CACHE_ITEMS
diff --git a/internal/feed/state.go b/internal/feed/state.go
index 3828e37..5831ff4 100644
--- a/internal/feed/state.go
+++ b/internal/feed/state.go
@@ -103,9 +103,12 @@ func (feed *Feed) filterItems() []item {
}
if res {
+ if log.IsDebug() {
+ log.Debugf("Filter '%s' matches for item %s", feed.ItemFilter, printItem(item.Item))
+ }
items = append(items, item)
} else if log.IsDebug() { // printItem is not for free
- log.Debugf("Filter '%s' matches for item %s, removing.", feed.ItemFilter, printItem(item.Item))
+ log.Debugf("Filter '%s' does not match for item %s", feed.ItemFilter, printItem(item.Item))
}
}
return items