Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit 165f7ca

Browse files
authored
Merge pull request #158 from an-prata/main
2 parents 81ee720 + 3c1c9ec commit 165f7ca

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

provider/mangadex/chapters.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,11 @@ func (m *Mangadex) ChaptersOf(manga *source.Manga) ([]*source.Chapter, error) {
6262
continue
6363
}
6464

65-
num, err := strconv.ParseUint(chapter.GetChapterNum(), 10, 16)
66-
n := uint16(num)
67-
if err != nil {
68-
n = uint16(i)
69-
}
70-
7165
name := chapter.GetTitle()
7266
if name == "" {
73-
name = fmt.Sprintf("Chapter %d", n)
67+
name = fmt.Sprintf("Chapter %s", chapter.GetChapterNum())
7468
} else {
75-
name = fmt.Sprintf("Chapter %d - %s", n, name)
69+
name = fmt.Sprintf("Chapter %s - %s", chapter.GetChapterNum(), name)
7670
}
7771

7872
var volume string
@@ -81,7 +75,7 @@ func (m *Mangadex) ChaptersOf(manga *source.Manga) ([]*source.Chapter, error) {
8175
}
8276
chapters = append(chapters, &source.Chapter{
8377
Name: name,
84-
Index: n,
78+
Index: uint16(i),
8579
ID: chapter.ID,
8680
URL: fmt.Sprintf("https://mangadex.org/chapter/%s", chapter.ID),
8781
Manga: manga,

0 commit comments

Comments
 (0)