Picacomic: Fix page index (#11550)

Co-authored-by: Carlos <2092019+CarlosEsco@users.noreply.github.com>
This commit is contained in:
anenasa 2022-04-21 18:35:06 +08:00 committed by GitHub
parent 43c9649974
commit 1bf3540a5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Picacomic'
pkgNameSuffix = 'zh.picacomic'
extClass = '.Picacomic'
extVersionCode = 1
extVersionCode = 2
isNsfw = true
}

View File

@ -80,6 +80,7 @@ data class PicaPages(
val docs: List<PicaPage>,
val page: Int,
val pages: Int,
val limit: Int
)
@Serializable

View File

@ -285,7 +285,7 @@ class Picacomic : HttpSource(), ConfigurableSource {
val ret = pages.docs.mapIndexed { index, picaPage ->
val url = picaPage.media.let { "${it.fileServer}/static/${it.path}" }
Page(index, "", url)
Page(index + (pages.page - 1) * pages.limit, "", url)
}.toMutableList()
if (pages.page < pages.pages) {