This commit is contained in:
Aria Moradi
2021-09-18 20:30:56 +04:30
parent 006efbbb77
commit 6d46d4b3da
9 changed files with 34 additions and 23 deletions

View File

@@ -71,9 +71,10 @@ object ExtensionController {
/** icon for extension named `apkName` */
fun icon(ctx: Context) {
val apkName = ctx.pathParam("apkName")
val useCache = ctx.queryParam("useCache")?.toBoolean() ?: true
ctx.future(
future { Extension.getExtensionIcon(apkName) }
future { Extension.getExtensionIcon(apkName, useCache) }
.thenApply {
ctx.header("content-type", it.second)
it.first

View File

@@ -31,9 +31,10 @@ object MangaController {
/** manga thumbnail */
fun thumbnail(ctx: Context) {
val mangaId = ctx.pathParam("mangaId").toInt()
val useCache = ctx.queryParam("useCache")?.toBoolean() ?: true
ctx.future(
future { Manga.getMangaThumbnail(mangaId) }
future { Manga.getMangaThumbnail(mangaId, useCache) }
.thenApply {
ctx.header("content-type", it.second)
it.first
@@ -152,9 +153,10 @@ object MangaController {
val mangaId = ctx.pathParam("mangaId").toInt()
val chapterIndex = ctx.pathParam("chapterIndex").toInt()
val index = ctx.pathParam("index").toInt()
val useCache = ctx.queryParam("useCache")?.toBoolean() ?: true
ctx.future(
future { Page.getPageImage(mangaId, chapterIndex, index) }
future { Page.getPageImage(mangaId, chapterIndex, index, useCache) }
.thenApply {
ctx.header("content-type", it.second)
it.first