fix liliana page order (#2473)

This commit is contained in:
Secozzi 2024-04-19 13:51:22 +00:00 committed by Draff
parent 0e20357684
commit 4030cebbbf
3 changed files with 22 additions and 11 deletions

View File

@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}
baseVersionCode = 1
baseVersionCode = 2

View File

@ -322,10 +322,18 @@ abstract class Liliana(
}
override fun pageListParse(document: Document): List<Page> {
return document.select("div.separator").mapIndexed { i, page ->
return if (document.selectFirst("div.separator[data-index]") == null) {
document.select("div.separator").mapIndexed { i, page ->
val url = page.selectFirst("a")!!.attr("abs:href")
Page(i, document.location(), url)
}
} else {
document.select("div.separator[data-index]").map { page ->
val index = page.attr("data-index").toInt()
val url = page.selectFirst("a")!!.attr("abs:href")
Page(index, document.location(), url)
}.sortedBy { it.index }
}
}
override fun imageUrlParse(document: Document) = ""

View File

@ -1,15 +1,18 @@
package eu.kanade.tachiyomi.extension.ja.mangakoma
import eu.kanade.tachiyomi.multisrc.liliana.Liliana
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Page
import org.jsoup.nodes.Document
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.Request
class MangaKoma : Liliana("Manga Koma", "https://mangakoma01.net", "ja") {
override fun pageListParse(document: Document): List<Page> {
return document.select("div.separator[data-index]").map { page ->
val index = page.attr("data-index").toInt()
val url = page.selectFirst("a")!!.attr("abs:href")
Page(index, document.location(), url)
}.sortedBy { it.index }
override fun imageRequest(page: Page): Request {
val imgHeaders = headersBuilder().apply {
add("Accept", "image/avif,image/webp,*/*")
add("Host", page.imageUrl!!.toHttpUrl().host)
removeAll("Referer")
}.build()
return GET(page.imageUrl!!, imgHeaders)
}
}