diff --git a/gparser/episodeparser.go b/gparser/episodeparser.go index da9d1e6..2f9ed95 100644 --- a/gparser/episodeparser.go +++ b/gparser/episodeparser.go @@ -105,7 +105,6 @@ func ParseEpisode(i int, s *goquery.Selection) { EP.Episode.Int64 = 0 EP.Name.String = removeRegex.ReplaceAllString(EP.Name.String, "") } - EP.Season.Int64 = 1 doc.Find(".article > p").Each(func(i int, s *goquery.Selection) { EP.Descr.String += s.Text() + "\n" }) diff --git a/gparser/lpparser.go b/gparser/lpparser.go index 220eccb..576f73c 100644 --- a/gparser/lpparser.go +++ b/gparser/lpparser.go @@ -120,15 +120,3 @@ func UpdateLP(LP database.LetsPlay) { } } } - -func DeleteEmptyLPs() { - var LPs []database.LetsPlay - database.Db.Find(&LPs) - for _, LP := range LPs { - var count int - database.Db.Model(database.Episode{}).Where("lets_play_id = ?", LP.ID).Count(&count) - if count == 0 { - database.Db.Delete(&LP) - } - } -} \ No newline at end of file diff --git a/gparser/sitemap.go b/gparser/sitemap.go index 721746c..876c51f 100644 --- a/gparser/sitemap.go +++ b/gparser/sitemap.go @@ -63,7 +63,7 @@ func GenerateSitemap() { func genLPs(uset *urlset) { var LPs []database.LetsPlay - database.Db.Find(&LPs) + database.Db.Where("aired IS NOT NULL").Find(&LPs) for _, LP := range LPs { var temp URL temp.Location = config.C.SiteUrl + "/lets-play/" + LP.Slug.String diff --git a/gparser/utils.go b/gparser/utils.go index 81fde93..49378c5 100644 --- a/gparser/utils.go +++ b/gparser/utils.go @@ -17,7 +17,6 @@ func UpdateAll() { log.Printf("*** FINISHED UPDATING LETSPLAYS ***") UpdateEpisodes() log.Printf("*** FINISHED UPDATING EPISODES ***") - DeleteEmptyLPs() GenerateSitemap() } @@ -30,7 +29,6 @@ func ParseAll() { log.Printf("*** FINISHED PARSING LETSPLAYS ***") ParseEpisodes() log.Printf("*** FINISHED PARSING EPISODES ***") - DeleteEmptyLPs() GenerateSitemap() }