From 97ce648e3467de394abcd0a86b96d7a7980638f6 Mon Sep 17 00:00:00 2001 From: Chopper <156493704+choppeh@users.noreply.github.com> Date: Thu, 24 Oct 2024 08:40:26 -0300 Subject: [PATCH] FenixManhwas: Fix chapters (#5656) Fix chapters --- src/pt/fenixmanhwas/build.gradle | 2 +- .../extension/pt/fenixmanhwas/FenixManhwas.kt | 27 +++++-------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/pt/fenixmanhwas/build.gradle b/src/pt/fenixmanhwas/build.gradle index b933b84d1..92ee4ac5a 100644 --- a/src/pt/fenixmanhwas/build.gradle +++ b/src/pt/fenixmanhwas/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.FenixManhwas' themePkg = 'zeistmanga' baseUrl = 'https://fenixleitura.blogspot.com' - overrideVersionCode = 0 + overrideVersionCode = 1 } apply from: "$rootDir/common.gradle" diff --git a/src/pt/fenixmanhwas/src/eu/kanade/tachiyomi/extension/pt/fenixmanhwas/FenixManhwas.kt b/src/pt/fenixmanhwas/src/eu/kanade/tachiyomi/extension/pt/fenixmanhwas/FenixManhwas.kt index 62e0471b0..266ac8be7 100644 --- a/src/pt/fenixmanhwas/src/eu/kanade/tachiyomi/extension/pt/fenixmanhwas/FenixManhwas.kt +++ b/src/pt/fenixmanhwas/src/eu/kanade/tachiyomi/extension/pt/fenixmanhwas/FenixManhwas.kt @@ -9,9 +9,9 @@ import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.util.asJsoup import kotlinx.serialization.decodeFromString -import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.Request import okhttp3.Response +import org.jsoup.nodes.Document class FenixManhwas : ZeistManga( "FĂȘnix Manhwas", @@ -32,25 +32,12 @@ class FenixManhwas : ZeistManga( setUrlWithoutDomain(document.location()) } - override fun chapterListRequest(manga: SManga): Request { - val url = "$baseUrl/feeds/posts/default/-/".toHttpUrl().newBuilder() - .addPathSegment(manga.title) - .addQueryParameter("alt", "json") - .addQueryParameter("start-index", "1") - .addQueryParameter("max-results", "99999") - .addQueryParameter("orderby", "updated") - .build() - return GET(url, headers) - } - - override fun chapterListParse(response: Response): List { - val result = json.decodeFromString(response.body.string()) - return result.feed?.entry - ?.filter { it.category.orEmpty().any { category -> category.term == chapterCategory } } - ?.map { it.toSChapter(baseUrl) } - ?.sortedBy { it.name } - ?.reversed() - ?: throw Exception("Failed to parse from chapter API") + override fun getChapterFeedUrl(doc: Document): String { + val feed = doc.selectFirst(".chapter_get")!!.attr("data-labelchapter") + return apiUrl(chapterCategory) + .addPathSegments(feed) + .addQueryParameter("max-results", maxChapterResults.toString()) + .build().toString() } override fun pageListRequest(chapter: SChapter): Request {