diff options
author | siddharth <s@ricketyspace.net> | 2021-11-28 17:23:55 -0500 |
---|---|---|
committer | siddharth <s@ricketyspace.net> | 2021-11-28 17:23:55 -0500 |
commit | 0ee116a416bf1868ed6ed3e7c040b24e13fdb549 (patch) | |
tree | 17d71cf76946d5a9c246c91b8cc10e8c5921354b /db/db.go | |
parent | 43dade27aa1cd5e77201c3100276f299e321d213 (diff) |
db: add FernDB.Exists
Diffstat (limited to 'db/db.go')
-rw-r--r-- | db/db.go | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 + +} + |