mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 19:34:35 -05:00
Update dependency io.javalin:javalin to v6 (#1152)
* Update dependency io.javalin:javalin to v6 * Simple compile fixes * Simple compile fixes pass 2 * Add results to futures * Setup jetty server and api routes * Setup Cors * Setup basic auth * Documentation stubs * Replace chapter mutex cache * Fix compile * Disable Jetty Logging --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Syer10 <syer10@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package suwayomi.tachidesk.manga.controller
|
||||
|
||||
import io.javalin.http.HttpCode
|
||||
import io.javalin.http.HttpStatus
|
||||
import suwayomi.tachidesk.manga.impl.backup.BackupFlags
|
||||
import suwayomi.tachidesk.manga.impl.backup.proto.ProtoBackupExport
|
||||
import suwayomi.tachidesk.manga.impl.backup.proto.ProtoBackupImport
|
||||
@@ -28,14 +28,16 @@ object BackupController {
|
||||
}
|
||||
},
|
||||
behaviorOf = { ctx ->
|
||||
ctx.future(
|
||||
ctx.future {
|
||||
future {
|
||||
ProtoBackupImport.restoreLegacy(ctx.bodyAsInputStream())
|
||||
},
|
||||
)
|
||||
ProtoBackupImport.restoreLegacy(ctx.bodyInputStream())
|
||||
}.thenApply {
|
||||
ctx.json(it)
|
||||
}
|
||||
}
|
||||
},
|
||||
withResults = {
|
||||
httpCode(HttpCode.OK)
|
||||
httpCode(HttpStatus.OK)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -54,15 +56,17 @@ object BackupController {
|
||||
},
|
||||
behaviorOf = { ctx ->
|
||||
// TODO: rewrite this with ctx.uploadedFiles(), don't call the multipart field "backup.proto.gz"
|
||||
ctx.future(
|
||||
ctx.future {
|
||||
future {
|
||||
ProtoBackupImport.restoreLegacy(ctx.uploadedFile("backup.proto.gz")!!.content)
|
||||
},
|
||||
)
|
||||
ProtoBackupImport.restoreLegacy(ctx.uploadedFile("backup.proto.gz")!!.content())
|
||||
}.thenApply {
|
||||
ctx.json(it)
|
||||
}
|
||||
}
|
||||
},
|
||||
withResults = {
|
||||
httpCode(HttpCode.OK)
|
||||
httpCode(HttpCode.NOT_FOUND)
|
||||
httpCode(HttpStatus.OK)
|
||||
httpCode(HttpStatus.NOT_FOUND)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -77,7 +81,7 @@ object BackupController {
|
||||
},
|
||||
behaviorOf = { ctx ->
|
||||
ctx.contentType("application/octet-stream")
|
||||
ctx.future(
|
||||
ctx.future {
|
||||
future {
|
||||
ProtoBackupExport.createBackup(
|
||||
BackupFlags(
|
||||
@@ -88,11 +92,11 @@ object BackupController {
|
||||
includeHistory = true,
|
||||
),
|
||||
)
|
||||
},
|
||||
)
|
||||
}.thenApply { ctx.result(it) }
|
||||
}
|
||||
},
|
||||
withResults = {
|
||||
stream(HttpCode.OK)
|
||||
stream(HttpStatus.OK)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -109,7 +113,7 @@ object BackupController {
|
||||
ctx.contentType("application/octet-stream")
|
||||
|
||||
ctx.header("Content-Disposition", """attachment; filename="${Backup.getFilename()}"""")
|
||||
ctx.future(
|
||||
ctx.future {
|
||||
future {
|
||||
ProtoBackupExport.createBackup(
|
||||
BackupFlags(
|
||||
@@ -120,11 +124,11 @@ object BackupController {
|
||||
includeHistory = true,
|
||||
),
|
||||
)
|
||||
},
|
||||
)
|
||||
}.thenApply { ctx.result(it) }
|
||||
}
|
||||
},
|
||||
withResults = {
|
||||
stream(HttpCode.OK)
|
||||
stream(HttpStatus.OK)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -138,14 +142,16 @@ object BackupController {
|
||||
}
|
||||
},
|
||||
behaviorOf = { ctx ->
|
||||
ctx.future(
|
||||
ctx.future {
|
||||
future {
|
||||
ProtoBackupValidator.validate(ctx.bodyAsInputStream())
|
||||
},
|
||||
)
|
||||
ProtoBackupValidator.validate(ctx.bodyInputStream())
|
||||
}.thenApply {
|
||||
ctx.json(it)
|
||||
}
|
||||
}
|
||||
},
|
||||
withResults = {
|
||||
json<ProtoBackupValidator.ValidationResult>(HttpCode.OK)
|
||||
json<ProtoBackupValidator.ValidationResult>(HttpStatus.OK)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -167,14 +173,16 @@ object BackupController {
|
||||
}
|
||||
},
|
||||
behaviorOf = { ctx ->
|
||||
ctx.future(
|
||||
ctx.future {
|
||||
future {
|
||||
ProtoBackupValidator.validate(ctx.uploadedFile("backup.proto.gz")!!.content)
|
||||
},
|
||||
)
|
||||
ProtoBackupValidator.validate(ctx.uploadedFile("backup.proto.gz")!!.content())
|
||||
}.thenApply {
|
||||
ctx.json(it)
|
||||
}
|
||||
}
|
||||
},
|
||||
withResults = {
|
||||
json<ProtoBackupValidator.ValidationResult>(HttpCode.OK)
|
||||
json<ProtoBackupValidator.ValidationResult>(HttpStatus.OK)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user