Demon Sect: Fix http 404 on popular and latest tabs (#1449)

Fix http 400 on popular and latest
This commit is contained in:
bapeey 2024-02-21 12:04:37 -05:00 committed by GitHub
parent 928d5407d8
commit e74bec17d0
2 changed files with 22 additions and 1 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.DemonSect'
themePkg = 'madara'
baseUrl = 'https://demonsect.com.br'
overrideVersionCode = 4
overrideVersionCode = 5
}
apply from: "$rootDir/common.gradle"

View File

@ -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<MangasPage> {
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<MangasPage> {
return client.newCall(latestUpdatesRequest(page))
.asObservable() // Site returns http 404 even if the result is successful
.map { response ->
latestUpdatesParse(response)
}
}
}