Update SimplyHentai extension to display all images, currently only first 12 images are shown. (#9607)

This commit is contained in:
rzmeu 2021-10-24 20:38:30 +03:00 committed by GitHub
parent 9f236a29f1
commit 262a20b7a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Simply Hentai' extName = 'Simply Hentai'
pkgNameSuffix = 'all.simplyhentai' pkgNameSuffix = 'all.simplyhentai'
extClass = '.SimplyHentaiFactory' extClass = '.SimplyHentaiFactory'
extVersionCode = 5 extVersionCode = 6
isNsfw = true isNsfw = true
} }

View File

@ -178,13 +178,14 @@ open class SimplyHentai(override val lang: String) : ConfigurableSource, HttpSou
override fun pageListRequest(chapter: SChapter) = override fun pageListRequest(chapter: SChapter) =
Uri.parse("$apiUrl/album").buildUpon().run { Uri.parse("$apiUrl/album").buildUpon().run {
appendEncodedPath(chapter.url.split('/')[2]) appendEncodedPath(chapter.url.split('/')[2])
appendEncodedPath("/pages")
appendQueryParameter("si", "0") appendQueryParameter("si", "0")
appendQueryParameter("locale", lang) appendQueryParameter("locale", lang)
GET(build().toString(), headers) GET(build().toString(), headers)
} }
override fun pageListParse(response: Response) = override fun pageListParse(response: Response) =
response.decode<SHAlbum>().data.images.map { response.decode<SHAlbumPages>().data.pages.map {
Page(it.page_num, "", it.sizes.full) Page(it.page_num, "", it.sizes.full)
} }

View File

@ -49,3 +49,11 @@ data class SHData(
) { ) {
val path by lazy { "/${series.slug}/$slug" } val path by lazy { "/${series.slug}/$slug" }
} }
@Serializable
data class SHAlbumPages(val data: SHPagesData)
@Serializable
data class SHPagesData(
val pages: List<SHImage>
)