mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 19:34:35 -05:00
fix Page index issues for some providers (#491)
This commit is contained in:
@@ -11,6 +11,7 @@ import eu.kanade.tachiyomi.source.local.LocalSource
|
|||||||
import eu.kanade.tachiyomi.source.model.Page
|
import eu.kanade.tachiyomi.source.model.Page
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||||
import kotlinx.coroutines.flow.StateFlow
|
import kotlinx.coroutines.flow.StateFlow
|
||||||
|
import org.jetbrains.exposed.sql.SortOrder
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.sql.and
|
||||||
import org.jetbrains.exposed.sql.select
|
import org.jetbrains.exposed.sql.select
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.sql.transactions.transaction
|
||||||
@@ -49,8 +50,11 @@ object Page {
|
|||||||
val chapterId = chapterEntry[ChapterTable.id].value
|
val chapterId = chapterEntry[ChapterTable.id].value
|
||||||
|
|
||||||
val pageEntry =
|
val pageEntry =
|
||||||
transaction { PageTable.select { (PageTable.chapter eq chapterId) and (PageTable.index eq index) }.first() }
|
transaction {
|
||||||
|
PageTable.select { (PageTable.chapter eq chapterId) }
|
||||||
|
.orderBy(PageTable.index to SortOrder.ASC)
|
||||||
|
.limit(1, index.toLong()).first()
|
||||||
|
}
|
||||||
val tachiyomiPage = Page(
|
val tachiyomiPage = Page(
|
||||||
pageEntry[PageTable.index],
|
pageEntry[PageTable.index],
|
||||||
pageEntry[PageTable.url],
|
pageEntry[PageTable.url],
|
||||||
|
|||||||
Reference in New Issue
Block a user