mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Do not crawl existing entry URLs
This commit is contained in:
parent
09785df07f
commit
3b62f904d6
3 changed files with 23 additions and 8 deletions
|
@ -226,3 +226,11 @@ func (s *Storage) MarkAllAsRead(userID int64) error {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
// EntryURLExists returns true if an entry with this URL already exists.
|
||||
func (s *Storage) EntryURLExists(userID 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)
|
||||
return result >= 1
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue