From e5d984849ed48cb7e7d8eab91338618cb8d04a9c Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Sat, 27 Feb 2016 17:06:00 +0100 Subject: [PATCH] Checking for deleted entries when checking if entry already present --- gparser/authorparser.go | 2 +- gparser/episodeparser.go | 2 +- gparser/lpparser.go | 2 +- gparser/ltparser.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gparser/authorparser.go b/gparser/authorparser.go index 56a3ef2..38414bf 100644 --- a/gparser/authorparser.go +++ b/gparser/authorparser.go @@ -39,7 +39,7 @@ func ParseAuthor(i int, s *goquery.Selection) { ur, _ := url.Parse(u) slug := path.Base(ur.Path) var count int - if database.Db.Model(database.Author{}).Where("slug = ?", slug).Count(&count); count > 0 { + if database.Db.Model(database.Author{}).Unscoped().Where("slug = ?", slug).Count(&count); count > 0 { return } diff --git a/gparser/episodeparser.go b/gparser/episodeparser.go index 323bcfe..c5f4ba1 100644 --- a/gparser/episodeparser.go +++ b/gparser/episodeparser.go @@ -59,7 +59,7 @@ func ParseEpisode(i int, s *goquery.Selection) { ur, _ := url.Parse(gu) slug := path.Base(ur.Path) var count int - if database.Db.Model(database.Episode{}).Where("slug = ?", slug).Count(&count); count > 0 { + if database.Db.Model(database.Episode{}).Unscoped().Where("slug = ?", slug).Count(&count); count > 0 { return } diff --git a/gparser/lpparser.go b/gparser/lpparser.go index 7411669..220eccb 100644 --- a/gparser/lpparser.go +++ b/gparser/lpparser.go @@ -31,7 +31,7 @@ func ParseLetsPlays() { ur, _ := url.Parse(u) slug := path.Base(ur.Path) var count int - if database.Db.Model(database.LetsPlay{}).Where("slug = ?", slug).Count(&count); count > 0 { + if database.Db.Model(database.LetsPlay{}).Unscoped().Where("slug = ?", slug).Count(&count); count > 0 { return } diff --git a/gparser/ltparser.go b/gparser/ltparser.go index f7d502f..7591993 100644 --- a/gparser/ltparser.go +++ b/gparser/ltparser.go @@ -29,7 +29,7 @@ func ParseLT(i int, s *goquery.Selection) { ur, _ := url.Parse(u) slug := path.Base(ur.Path) var count int - if database.Db.Model(database.LetsTest{}).Where("slug = ?", slug).Count(&count); count > 0 { + if database.Db.Model(database.LetsTest{}).Unscoped().Where("slug = ?", slug).Count(&count); count > 0 { return }