reader done
This commit is contained in:
@@ -81,9 +81,10 @@ class Main {
|
||||
ctx.json(getChapterList(mangaId))
|
||||
}
|
||||
|
||||
app.get("/api/v1/chapter/:chapterId") { ctx ->
|
||||
app.get("/api/v1/manga/:mangaId/chapter/:chapterId") { ctx ->
|
||||
val chapterId = ctx.pathParam("chapterId").toInt()
|
||||
ctx.json(getPages(chapterId))
|
||||
val mangaId = ctx.pathParam("mangaId").toInt()
|
||||
ctx.json(getPages(chapterId,mangaId))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,10 +56,10 @@ fun getChapterList(mangaId: Int): List<ChapterDataClass> {
|
||||
}
|
||||
}
|
||||
|
||||
fun getPages(chapterId: Int): List<PageDataClass> {
|
||||
fun getPages(chapterId: Int, mangaId: Int): List<PageDataClass> {
|
||||
return transaction {
|
||||
val chapterEntry = ChapterTable.select { ChapterTable.id eq chapterId }.firstOrNull()!!
|
||||
val mangaId = chapterEntry[ChapterTable.manga].value
|
||||
assert(mangaId == chapterEntry[ChapterTable.manga].value) // sanity check
|
||||
val mangaEntry = MangaTable.select { MangaTable.id eq mangaId }.firstOrNull()!!
|
||||
val source = getHttpSource(mangaEntry[MangaTable.sourceReference].value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user