Fix issue #1 again (this time it should work)

This commit is contained in:
Andreas Mieke 2015-10-18 21:20:07 +02:00
parent 9997c700e7
commit f557d6c0da
2 changed files with 7 additions and 2 deletions

View file

@ -83,7 +83,11 @@ func ParseFeedEpisode(u string, bar *pb.ProgressBar) {
database.Db.Where("slug = ?", path.Base(path.Dir(ur.Path))).First(&LP)
if LP.ID == 0 {
wg.Add(1)
ParseLPPage(path.Base(path.Dir(ur.Path)), &LP, nil)
LP.Slug.String = path.Base(path.Dir(ur.Path))
ParseLPPage(LP.Slug.String, &LP, nil)
if LP.ID == 0 {
return
}
}
EP.LetsPlayID = LP.ID
res, err := GetHTTPResource(u)

View file

@ -39,7 +39,6 @@ func ParseLetsPlays() {
var LP database.LetsPlay
LP.Slug.String = slug
LP.Name.String, _ = s.Attr("title")
wg.Add(1)
go ParseLPPage(LP.Slug.String, &LP, bar)
})
@ -63,6 +62,8 @@ func ParseLPPage(gslug string, LP *database.LetsPlay, bar *pb.ProgressBar) {
return
}
LP.Name.String = doc.Find("h1 > a > strong").First().Text()
pos, _ := doc.Find(".lightbox").Attr("href")
LP.PosterS.String, LP.PosterB.String, err = image.ResizeCover(pos)
if err != nil {