Skip to content

Commit

Permalink
Fix float parsing issue in manganelo grabber (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
elboletaire authored Jan 20, 2023
1 parent 0c65940 commit ea81974
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions grabber/manganelo.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ func (m Manganelo) FetchChapters() (chapters Filterables, errs []error) {
m.rows.Each(func(i int, s *goquery.Selection) {
re := regexp.MustCompile(`(\d+\.?\d*)`)
num := re.FindString(s.Find("a").Text())
// if the chapter has no number, we skip it (usually it's an announcement from the site)
if num == "" {
return
}
number, err := strconv.ParseFloat(num, 64)
if err != nil {
errs = append(errs, err)
Expand Down

0 comments on commit ea81974

Please sign in to comment.