got rid of legacy backups

This commit is contained in:
Aria Moradi
2021-08-21 06:23:58 +04:30
parent 1e094a467a
commit 6c278604ec
13 changed files with 0 additions and 794 deletions

View File

@@ -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) {