changes needed for tachiyomi tracker

This commit is contained in:
Aria Moradi
2022-11-10 02:13:20 +03:30
parent 39490ce7ba
commit 65067e6e01
5 changed files with 74 additions and 8 deletions

View File

@@ -33,13 +33,12 @@ import kotlin.time.Duration.Companion.days
object MangaController {
private val json by DI.global.instance<Json>()
/** get manga info */
val retrieve = handler(
pathParam<Int>("mangaId"),
queryParam("onlineFetch", false),
documentWith = {
withOperation {
summary("Get a manga")
summary("Get manga info")
description("Get a manga from the database using a specific id.")
}
},
@@ -56,6 +55,29 @@ object MangaController {
}
)
/** get manga info with all data filled in */
val retrieveFull = handler(
pathParam<Int>("mangaId"),
queryParam("onlineFetch", false),
documentWith = {
withOperation {
summary("Get manga info with all data filled in")
description("Get a manga from the database using a specific id.")
}
},
behaviorOf = { ctx, mangaId, onlineFetch ->
ctx.future(
future {
Manga.getMangaFull(mangaId, onlineFetch)
}
)
},
withResults = {
json<MangaDataClass>(HttpCode.OK)
httpCode(HttpCode.NOT_FOUND)
}
)
/** manga thumbnail */
val thumbnail = handler(
pathParam<Int>("mangaId"),