diff --git a/src/en/zeroscans/CHANGELOG.md b/src/en/zeroscans/CHANGELOG.md index 9782c5f50..2513d1e3a 100644 --- a/src/en/zeroscans/CHANGELOG.md +++ b/src/en/zeroscans/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.6 + +Add explicit rateLimit to api chapter endpoint + ## 1.2.5 Change to Main Domain from Beta one diff --git a/src/en/zeroscans/build.gradle b/src/en/zeroscans/build.gradle index 3f4f1cf88..6b92dd0a1 100644 --- a/src/en/zeroscans/build.gradle +++ b/src/en/zeroscans/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Zero Scans' pkgNameSuffix = 'en.zeroscans' extClass = '.ZeroScans' - extVersionCode = 5 + extVersionCode = 6 } apply from: "$rootDir/common.gradle" diff --git a/src/en/zeroscans/src/eu/kanade/tachiyomi/extension/en/zeroscans/ZeroScans.kt b/src/en/zeroscans/src/eu/kanade/tachiyomi/extension/en/zeroscans/ZeroScans.kt index 09f801341..9a9668036 100644 --- a/src/en/zeroscans/src/eu/kanade/tachiyomi/extension/en/zeroscans/ZeroScans.kt +++ b/src/en/zeroscans/src/eu/kanade/tachiyomi/extension/en/zeroscans/ZeroScans.kt @@ -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> { + // Paginated fragile endpoint so explicit rateLimit + val chapterListClient = client.newBuilder().rateLimit(1, 2).build() + val zsChapters = mutableListOf() + 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