From f3fc8b70721524867a3dac7d2bcb548b830c282a Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Thu, 28 Feb 2019 20:43:33 -0800 Subject: Use feed ID instead of user ID to check entry URLs presence --- storage/entry.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'storage') diff --git a/storage/entry.go b/storage/entry.go index ec31843..811a207 100644 --- a/storage/entry.go +++ b/storage/entry.go @@ -316,9 +316,9 @@ func (s *Storage) MarkCategoryAsRead(userID, categoryID int64, before time.Time) } // EntryURLExists returns true if an entry with this URL already exists. -func (s *Storage) EntryURLExists(userID int64, entryURL string) bool { +func (s *Storage) EntryURLExists(feedID int64, entryURL string) bool { var result int - query := `SELECT count(*) as c FROM entries WHERE user_id=$1 AND url=$2` - s.db.QueryRow(query, userID, entryURL).Scan(&result) + query := `SELECT count(*) as c FROM entries WHERE feed_id=$1 AND url=$2` + s.db.QueryRow(query, feedID, entryURL).Scan(&result) return result >= 1 } -- cgit v1.2.3