From acaa33bc246fb6fca19abcf0f8c97c615a3ca111 Mon Sep 17 00:00:00 2001 From: bapeey <90949336+bapeey@users.noreply.github.com> Date: Wed, 5 Jun 2024 07:19:31 -0500 Subject: [PATCH] MangaFire: Fix volume entries (#3404) Is like if someone deleted this on purpose --- src/all/mangafire/build.gradle | 2 +- .../kanade/tachiyomi/extension/all/mangafire/MangaFire.kt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/all/mangafire/build.gradle b/src/all/mangafire/build.gradle index 73b413c2e..68375cac3 100644 --- a/src/all/mangafire/build.gradle +++ b/src/all/mangafire/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.MangaFireFactory' themePkg = 'mangareader' baseUrl = 'https://mangafire.to' - overrideVersionCode = 4 + overrideVersionCode = 5 isNsfw = true } diff --git a/src/all/mangafire/src/eu/kanade/tachiyomi/extension/all/mangafire/MangaFire.kt b/src/all/mangafire/src/eu/kanade/tachiyomi/extension/all/mangafire/MangaFire.kt index ada9b6598..bd3ca013c 100644 --- a/src/all/mangafire/src/eu/kanade/tachiyomi/extension/all/mangafire/MangaFire.kt +++ b/src/all/mangafire/src/eu/kanade/tachiyomi/extension/all/mangafire/MangaFire.kt @@ -138,13 +138,13 @@ open class MangaFire( override fun parseChapterElements(response: Response, isVolume: Boolean): List { val result = json.decodeFromString>(response.body.string()).result val document = Jsoup.parse(result) - - val elements = document.select("ul li") + val selector = if (isVolume) "div.unit" else "ul li" + val elements = document.select(selector) if (elements.size > 0) { val linkToFirstChapter = elements[0].selectFirst(Evaluator.Tag("a"))!!.attr("href") val mangaId = linkToFirstChapter.toString().substringAfter('.').substringBefore('/') - - val request = GET("$baseUrl/ajax/read/$mangaId/chapter/$langCode", headers) + val type = if (isVolume) volumeType else chapterType + val request = GET("$baseUrl/ajax/read/$mangaId/$type/$langCode", headers) val response = client.newCall(request).execute() val res = json.decodeFromString>(response.body.string()).result.html val chapterInfoDocument = Jsoup.parse(res)