Checking for deleted entries when checking if entry already present

This commit is contained in:
Andreas Mieke 2016-02-27 17:06:00 +01:00
parent d6ac82fabf
commit e5d984849e
4 changed files with 4 additions and 4 deletions

View file

@ -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
}

View file

@ -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
}

View file

@ -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
}

View file

@ -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
}