Refactors the indexing and the syntax

Human queries are now in french. Sorry for that
This commit is contained in:
2016-01-21 16:27:38 +01:00
parent dc0830a559
commit 0d3e8b922a
6 changed files with 316 additions and 336 deletions

View File

@@ -99,6 +99,7 @@ func (g *AlbumDescriptionGetter) Get(a *Album) error {
details := map[string][]*goquery.Selection{}
previous := ""
a.Links = map[string]string{}
doc.Find("div.detail-album ul.infos-albums li").Each(func(i int, s *goquery.Selection) {
labelSelection := s.Find("label")
if labelSelection.Size() != 1 {
@@ -121,7 +122,8 @@ func (g *AlbumDescriptionGetter) Get(a *Album) error {
for _, s := range sList {
l := linkFromSelection(s.Find("a"))
if len(l.Title) > 0 {
a.Scenarist = append(a.Scenarist, l)
a.Scenarists = append(a.Scenarists, l.Title)
a.Links[l.Title] = l.Target
}
}
errors <- nil
@@ -137,7 +139,8 @@ func (g *AlbumDescriptionGetter) Get(a *Album) error {
for _, s := range sList {
l := linkFromSelection(s.Find("a"))
if len(l.Title) > 0 {
a.Designer = append(a.Designer, l)
a.Designers = append(a.Designers, l.Title)
a.Links[l.Title] = l.Target
}
}
errors <- nil
@@ -153,7 +156,8 @@ func (g *AlbumDescriptionGetter) Get(a *Album) error {
for _, s := range sList {
l := linkFromSelection(s.Find("a"))
if len(l.Title) > 0 {
a.Colorist = append(a.Colorist, l)
a.Colorists = append(a.Colorists, l.Title)
a.Links[l.Title] = l.Target
}
}
errors <- nil