parent
0d852ad121
commit
4aa14a2cbd
|
@ -1,3 +1,7 @@
|
|||
## 1.3.6
|
||||
|
||||
Add explicit rateLimit to api chapter endpoint
|
||||
|
||||
## 1.2.5
|
||||
|
||||
Change to Main Domain from Beta one
|
||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
|||
extName = 'Zero Scans'
|
||||
pkgNameSuffix = 'en.zeroscans'
|
||||
extClass = '.ZeroScans'
|
||||
extVersionCode = 5
|
||||
extVersionCode = 6
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.extension.en.zeroscans
|
|||
|
||||
import android.util.Log
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.model.Filter
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
import eu.kanade.tachiyomi.source.model.MangasPage
|
||||
|
@ -152,20 +153,15 @@ class ZeroScans : HttpSource() {
|
|||
}
|
||||
|
||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
||||
// Paginated fragile endpoint so explicit rateLimit
|
||||
val chapterListClient = client.newBuilder().rateLimit(1, 2).build()
|
||||
val zsChapters = mutableListOf<ZeroScansChapterDto>()
|
||||
var page = 0
|
||||
var hasMoreResult = true
|
||||
try {
|
||||
var page = 1
|
||||
|
||||
val response = client.newCall(zsChapterListRequest(page, manga)).execute()
|
||||
|
||||
val zsChapterPage = zsChapterListParse(response)
|
||||
|
||||
val zsChapters = zsChapterPage.chapters.toMutableList()
|
||||
|
||||
var hasMoreResult = zsChapterPage.hasNextPage
|
||||
|
||||
while (hasMoreResult) {
|
||||
page++
|
||||
val newResponse = client.newCall(zsChapterListRequest(page, manga)).execute()
|
||||
val newResponse = chapterListClient.newCall(zsChapterListRequest(page, manga)).execute()
|
||||
val newZSChapterPage = zsChapterListParse(newResponse)
|
||||
zsChapters.addAll(newZSChapterPage.chapters)
|
||||
hasMoreResult = newZSChapterPage.hasNextPage
|
||||
|
|
Loading…
Reference in New Issue