From e74bec17d0536c77df2db790e31a7ca867735603 Mon Sep 17 00:00:00 2001 From: bapeey <90949336+bapeey@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:04:37 -0500 Subject: [PATCH] Demon Sect: Fix http 404 on popular and latest tabs (#1449) Fix http 400 on popular and latest --- src/pt/prismascans/build.gradle | 2 +- .../extension/pt/prismascans/DemonSect.kt | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/pt/prismascans/build.gradle b/src/pt/prismascans/build.gradle index fe6e3a859..23d0d1ee6 100644 --- a/src/pt/prismascans/build.gradle +++ b/src/pt/prismascans/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.DemonSect' themePkg = 'madara' baseUrl = 'https://demonsect.com.br' - overrideVersionCode = 4 + overrideVersionCode = 5 } apply from: "$rootDir/common.gradle" diff --git a/src/pt/prismascans/src/eu/kanade/tachiyomi/extension/pt/prismascans/DemonSect.kt b/src/pt/prismascans/src/eu/kanade/tachiyomi/extension/pt/prismascans/DemonSect.kt index 878d1f4a0..62f0b1622 100644 --- a/src/pt/prismascans/src/eu/kanade/tachiyomi/extension/pt/prismascans/DemonSect.kt +++ b/src/pt/prismascans/src/eu/kanade/tachiyomi/extension/pt/prismascans/DemonSect.kt @@ -1,8 +1,11 @@ package eu.kanade.tachiyomi.extension.pt.prismascans import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.asObservable import eu.kanade.tachiyomi.network.interceptor.rateLimit +import eu.kanade.tachiyomi.source.model.MangasPage import okhttp3.OkHttpClient +import rx.Observable import java.text.SimpleDateFormat import java.util.Locale import java.util.concurrent.TimeUnit @@ -21,5 +24,23 @@ class DemonSect : Madara( .rateLimit(1, 2, TimeUnit.SECONDS) .build() + override val useLoadMoreRequest = LoadMoreStrategy.Never + override val useNewChapterEndpoint = true + + override fun fetchPopularManga(page: Int): Observable { + return client.newCall(popularMangaRequest(page)) + .asObservable() // Site returns http 404 even if the result is successful + .map { response -> + popularMangaParse(response) + } + } + + override fun fetchLatestUpdates(page: Int): Observable { + return client.newCall(latestUpdatesRequest(page)) + .asObservable() // Site returns http 404 even if the result is successful + .map { response -> + latestUpdatesParse(response) + } + } }