mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-08 05:14:37 -05:00
got rid of legacy backups
This commit is contained in:
@@ -2,8 +2,6 @@ package suwayomi.tachidesk.manga.controller
|
||||
|
||||
import io.javalin.http.Context
|
||||
import suwayomi.tachidesk.manga.impl.backup.BackupFlags
|
||||
import suwayomi.tachidesk.manga.impl.backup.legacy.LegacyBackupExport
|
||||
import suwayomi.tachidesk.manga.impl.backup.legacy.LegacyBackupImport
|
||||
import suwayomi.tachidesk.manga.impl.backup.proto.ProtoBackupExport
|
||||
import suwayomi.tachidesk.manga.impl.backup.proto.ProtoBackupImport
|
||||
import suwayomi.tachidesk.manga.impl.backup.proto.ProtoBackupValidator
|
||||
@@ -19,62 +17,6 @@ import java.util.Date
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
object BackupController {
|
||||
/** expects a Tachiyomi legacy backup json in the body */
|
||||
fun legacyImport(ctx: Context) {
|
||||
ctx.result(
|
||||
JavalinSetup.future {
|
||||
LegacyBackupImport.performRestore(ctx.bodyAsInputStream())
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/** expects a Tachiyomi legacy backup json as a file upload, the file must be named "backup.json" */
|
||||
fun legacyImportFile(ctx: Context) {
|
||||
ctx.result(
|
||||
JavalinSetup.future {
|
||||
LegacyBackupImport.performRestore(ctx.uploadedFile("backup.json")!!.content)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/** returns a Tachiyomi legacy backup json created from the current database as a json body */
|
||||
fun legacyExport(ctx: Context) {
|
||||
ctx.contentType("application/json")
|
||||
ctx.result(
|
||||
JavalinSetup.future {
|
||||
LegacyBackupExport.createBackup(
|
||||
BackupFlags(
|
||||
includeManga = true,
|
||||
includeCategories = true,
|
||||
includeChapters = true,
|
||||
includeTracking = true,
|
||||
includeHistory = true,
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/** returns a Tachiyomi legacy backup json created from the current database as a file */
|
||||
fun legacyExportFile(ctx: Context) {
|
||||
ctx.contentType("application/json")
|
||||
val currentDate = SimpleDateFormat("yyyy-MM-dd_HH-mm").format(Date())
|
||||
|
||||
ctx.header("Content-Disposition", """attachment; filename="tachidesk_$currentDate.json"""")
|
||||
ctx.result(
|
||||
JavalinSetup.future {
|
||||
LegacyBackupExport.createBackup(
|
||||
BackupFlags(
|
||||
includeManga = true,
|
||||
includeCategories = true,
|
||||
includeChapters = true,
|
||||
includeTracking = true,
|
||||
includeHistory = true,
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/** expects a Tachiyomi protobuf backup in the body */
|
||||
fun protobufImport(ctx: Context) {
|
||||
|
||||
Reference in New Issue
Block a user