diff options
author | Frédéric Guillot <fred@miniflux.net> | 2019-02-28 20:43:33 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2019-02-28 20:43:33 -0800 |
commit | f3fc8b70721524867a3dac7d2bcb548b830c282a (patch) | |
tree | d82d6a29e09a5fc66df5f873e9a250b9267de9c7 /storage | |
parent | 1634e267b8fe33d2f74454fb43c471d224642a89 (diff) |
Use feed ID instead of user ID to check entry URLs presence
Diffstat (limited to 'storage')
-rw-r--r-- | storage/entry.go | 6 |
1 files changed, 3 insertions, 3 deletions
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 } |