NineHentai: fix galleries with broken last page (#5841)
This commit is contained in:
parent
3eed4041cb
commit
eeb2f25e9d
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'NineHentai'
|
||||
pkgNameSuffix = 'all.ninehentai'
|
||||
extClass = '.NineHentai'
|
||||
extVersionCode = 8
|
||||
extVersionCode = 9
|
||||
libVersion = '1.2'
|
||||
containsNsfw = true
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.google.gson.Gson
|
|||
import com.google.gson.JsonElement
|
||||
import com.google.gson.JsonParser
|
||||
import eu.kanade.tachiyomi.annotations.Nsfw
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.POST
|
||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||
import eu.kanade.tachiyomi.source.model.Filter
|
||||
|
@ -162,6 +163,15 @@ class NineHentai : HttpSource() {
|
|||
}
|
||||
val pages = mutableListOf<Page>()
|
||||
|
||||
client.newCall(
|
||||
GET(
|
||||
"$imageUrl/preview/${totalPages}t.jpg",
|
||||
headersBuilder().build()
|
||||
)
|
||||
).execute().code().let { code ->
|
||||
if (code == 404) totalPages--
|
||||
}
|
||||
|
||||
for (i in 1..totalPages) {
|
||||
pages.add(Page(pages.size, "", "$imageUrl/$i.jpg"))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue