summaryrefslogtreecommitdiffstats
path: root/db/db.go
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2021-11-28 17:23:55 -0500
committersiddharth <s@ricketyspace.net>2021-11-28 17:23:55 -0500
commit0ee116a416bf1868ed6ed3e7c040b24e13fdb549 (patch)
tree17d71cf76946d5a9c246c91b8cc10e8c5921354b /db/db.go
parent43dade27aa1cd5e77201c3100276f299e321d213 (diff)
db: add FernDB.Exists
Diffstat (limited to 'db/db.go')
-rw-r--r--db/db.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/db/db.go b/db/db.go
index 6bc6d04..6dfda22 100644
--- a/db/db.go
+++ b/db/db.go
@@ -68,3 +68,17 @@ func Open() (*FernDB, error) {
}
return db, nil
}
+
+func (fdb *FernDB) Exists(feed, entry string) bool {
+ if _, ok := fdb.downloaded[feed]; !ok {
+ return false
+ }
+ for _, e := range fdb.downloaded[feed] {
+ if e == entry {
+ return true
+ }
+ }
+ return false
+
+}
+