diff --git a/src/en/mangamutiny/build.gradle b/src/en/mangamutiny/build.gradle index 7bd2e1ebe..6e4c4b14a 100644 --- a/src/en/mangamutiny/build.gradle +++ b/src/en/mangamutiny/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Manga Mutiny' pkgNameSuffix = "en.mangamutiny" extClass = '.MangaMutiny' - extVersionCode = 5 + extVersionCode = 6 libVersion = '1.2' containsNsfw = true } diff --git a/src/en/mangamutiny/src/eu/kanade/tachiyomi/extension/en/mangamutiny/MangaMutiny.kt b/src/en/mangamutiny/src/eu/kanade/tachiyomi/extension/en/mangamutiny/MangaMutiny.kt index 929b43bea..34d9853fb 100644 --- a/src/en/mangamutiny/src/eu/kanade/tachiyomi/extension/en/mangamutiny/MangaMutiny.kt +++ b/src/en/mangamutiny/src/eu/kanade/tachiyomi/extension/en/mangamutiny/MangaMutiny.kt @@ -75,7 +75,7 @@ class MangaMutiny : HttpSource() { mangaDetailsRequestCommon(manga, false) override fun chapterListParse(response: Response): List { - val chapterList = ArrayList() + val chapterList = mutableListOf() val responseBody = response.body() if (responseBody != null) { @@ -89,18 +89,27 @@ class MangaMutiny : HttpSource() { name = chapterTitleBuilder(singleChapterJsonObject) url = singleChapterJsonObject.get("slug").asString date_upload = parseDate(singleChapterJsonObject.get("releasedAt").asString) + + chapterNumberBuilder(singleChapterJsonObject)?.let { chapterNumber -> + chapter_number = chapterNumber + } } ) } + + responseBody.close() } return chapterList } + private fun chapterNumberBuilder(rootNode: JsonObject): Float? = + rootNode.getNullable("chapter")?.asFloat + private fun chapterTitleBuilder(rootNode: JsonObject): String { val volume = rootNode.getNullable("volume")?.asInt - val chapter = rootNode.getNullable("chapter")?.asInt + val chapter = rootNode.getNullable("chapter")?.asFloat val textTitle = rootNode.getNullable("title")?.asString @@ -172,6 +181,8 @@ class MangaMutiny : HttpSource() { genre = rootNode.get("tags").asJsonArray .joinToString { singleGenre -> singleGenre.asString } } + + responseBody.close() } return manga @@ -206,6 +217,8 @@ class MangaMutiny : HttpSource() { for (i in 0 until images.size()) { pageList.add(Page(i, "", chapterUrl + images[i].asString)) } + + responseBody.close() } return pageList