From 3c1c9ececf03037d74cb7b3f83f4717bec3b7cba Mon Sep 17 00:00:00 2001 From: Evan Overman Date: Tue, 14 Feb 2023 17:05:31 -0800 Subject: [PATCH] fix naming and order in mangadex --- provider/mangadex/chapters.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/provider/mangadex/chapters.go b/provider/mangadex/chapters.go index 5255ea36..6d95e9bd 100644 --- a/provider/mangadex/chapters.go +++ b/provider/mangadex/chapters.go @@ -62,17 +62,11 @@ func (m *Mangadex) ChaptersOf(manga *source.Manga) ([]*source.Chapter, error) { continue } - num, err := strconv.ParseUint(chapter.GetChapterNum(), 10, 16) - n := uint16(num) - if err != nil { - n = uint16(i) - } - name := chapter.GetTitle() if name == "" { - name = fmt.Sprintf("Chapter %d", n) + name = fmt.Sprintf("Chapter %s", chapter.GetChapterNum()) } else { - name = fmt.Sprintf("Chapter %d - %s", n, name) + name = fmt.Sprintf("Chapter %s - %s", chapter.GetChapterNum(), name) } var volume string @@ -81,7 +75,7 @@ func (m *Mangadex) ChaptersOf(manga *source.Manga) ([]*source.Chapter, error) { } chapters = append(chapters, &source.Chapter{ Name: name, - Index: n, + Index: uint16(i), ID: chapter.ID, URL: fmt.Sprintf("https://mangadex.org/chapter/%s", chapter.ID), Manga: manga,