diff options
Diffstat (limited to 'storage')
-rw-r--r-- | storage/entry.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/storage/entry.go b/storage/entry.go index d1e8798..5ff5f5c 100644 --- a/storage/entry.go +++ b/storage/entry.go @@ -116,15 +116,17 @@ func (s *Storage) entryExists(entry *model.Entry) bool { return result >= 1 } -// UpdateEntries update a list of entries while refreshing a feed. -func (s *Storage) UpdateEntries(userID, feedID int64, entries model.Entries) (err error) { +// UpdateEntries updates a list of entries while refreshing a feed. +func (s *Storage) UpdateEntries(userID, feedID int64, entries model.Entries, updateExistingEntries bool) (err error) { var entryHashes []string for _, entry := range entries { entry.UserID = userID entry.FeedID = feedID if s.entryExists(entry) { - err = s.updateEntry(entry) + if updateExistingEntries { + err = s.updateEntry(entry) + } } else { err = s.createEntry(entry) } |