mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-13 07:44:34 -05:00
Fix pages after refactoring downloads (#1639)
This commit is contained in:
@@ -48,7 +48,8 @@ object Page {
|
||||
|
||||
suspend fun getPageImage(
|
||||
mangaId: Int,
|
||||
chapterId: Int,
|
||||
chapterId: Int? = null,
|
||||
chapterIndex: Int? = null,
|
||||
index: Int,
|
||||
format: String? = null,
|
||||
progressFlow: ((StateFlow<Int>) -> Unit)? = null,
|
||||
@@ -56,10 +57,17 @@ object Page {
|
||||
val mangaEntry = transaction { MangaTable.selectAll().where { MangaTable.id eq mangaId }.first() }
|
||||
val chapterEntry =
|
||||
transaction {
|
||||
ChapterTable
|
||||
.selectAll()
|
||||
.where { ChapterTable.id eq chapterId }
|
||||
.first()
|
||||
if (chapterId != null) {
|
||||
ChapterTable
|
||||
.selectAll()
|
||||
.where { ChapterTable.id eq chapterId }
|
||||
.first()
|
||||
} else {
|
||||
ChapterTable
|
||||
.selectAll()
|
||||
.where { ChapterTable.manga eq mangaId and (ChapterTable.sourceOrder eq chapterIndex!!) }
|
||||
.first()
|
||||
}
|
||||
}
|
||||
val chapterId = chapterEntry[ChapterTable.id].value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user