1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Do not try to update a duplicated feed after a refresh

This commit is contained in:
Frédéric Guillot 2020-09-20 23:29:51 -07:00
parent e6c6ee441a
commit 0d0395b4e3
2 changed files with 15 additions and 0 deletions

View file

@ -68,6 +68,14 @@ func (s *Storage) FeedURLExists(userID int64, feedURL string) bool {
return result
}
// AnotherFeedURLExists checks if the user a duplicated feed.
func (s *Storage) AnotherFeedURLExists(userID, feedID int64, feedURL string) bool {
var result bool
query := `SELECT true FROM feeds WHERE id <> $1 AND user_id=$2 AND feed_url=$3`
s.db.QueryRow(query, feedID, userID, feedURL).Scan(&result)
return result
}
// CountFeeds returns the number of feeds that belongs to the given user.
func (s *Storage) CountFeeds(userID int64) int {
var result int