Fix issue #1 again (this time it should work)
This commit is contained in:
parent
9997c700e7
commit
f557d6c0da
|
@ -83,7 +83,11 @@ func ParseFeedEpisode(u string, bar *pb.ProgressBar) {
|
||||||
database.Db.Where("slug = ?", path.Base(path.Dir(ur.Path))).First(&LP)
|
database.Db.Where("slug = ?", path.Base(path.Dir(ur.Path))).First(&LP)
|
||||||
if LP.ID == 0 {
|
if LP.ID == 0 {
|
||||||
wg.Add(1)
|
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
|
EP.LetsPlayID = LP.ID
|
||||||
res, err := GetHTTPResource(u)
|
res, err := GetHTTPResource(u)
|
||||||
|
|
|
@ -39,7 +39,6 @@ func ParseLetsPlays() {
|
||||||
|
|
||||||
var LP database.LetsPlay
|
var LP database.LetsPlay
|
||||||
LP.Slug.String = slug
|
LP.Slug.String = slug
|
||||||
LP.Name.String, _ = s.Attr("title")
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go ParseLPPage(LP.Slug.String, &LP, bar)
|
go ParseLPPage(LP.Slug.String, &LP, bar)
|
||||||
})
|
})
|
||||||
|
@ -63,6 +62,8 @@ func ParseLPPage(gslug string, LP *database.LetsPlay, bar *pb.ProgressBar) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LP.Name.String = doc.Find("h1 > a > strong").First().Text()
|
||||||
|
|
||||||
pos, _ := doc.Find(".lightbox").Attr("href")
|
pos, _ := doc.Find(".lightbox").Attr("href")
|
||||||
LP.PosterS.String, LP.PosterB.String, err = image.ResizeCover(pos)
|
LP.PosterS.String, LP.PosterB.String, err = image.ResizeCover(pos)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue