From 47fcf7eb97e60f63a1acbe4a6495f1558413bd02 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Fri, 2 Apr 2021 18:10:02 +0430 Subject: [PATCH] export extensions --- .../impl/backup/legacy/LegacyBackupExport.kt | 8 ++++--- .../ir/armor/tachidesk/server/JavalinSetup.kt | 22 +++++++++---------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/server/src/main/kotlin/ir/armor/tachidesk/impl/backup/legacy/LegacyBackupExport.kt b/server/src/main/kotlin/ir/armor/tachidesk/impl/backup/legacy/LegacyBackupExport.kt index ecc5ad3..1136942 100644 --- a/server/src/main/kotlin/ir/armor/tachidesk/impl/backup/legacy/LegacyBackupExport.kt +++ b/server/src/main/kotlin/ir/armor/tachidesk/impl/backup/legacy/LegacyBackupExport.kt @@ -121,6 +121,8 @@ object LegacyBackupExport { } } + // TODO the rest + return entry } @@ -130,8 +132,8 @@ object LegacyBackupExport { } private fun backupExtensionInfo(root: JsonArray, extensions: Set) { // TODO -// extensions.sorted().forEach { -// root.add(it) -// } + extensions.sorted().forEach { + root.add(it) + } } } diff --git a/server/src/main/kotlin/ir/armor/tachidesk/server/JavalinSetup.kt b/server/src/main/kotlin/ir/armor/tachidesk/server/JavalinSetup.kt index 3051935..43601ae 100644 --- a/server/src/main/kotlin/ir/armor/tachidesk/server/JavalinSetup.kt +++ b/server/src/main/kotlin/ir/armor/tachidesk/server/JavalinSetup.kt @@ -327,24 +327,24 @@ object JavalinSetup { // expects a Tachiyomi legacy backup file to be uploaded app.get("/api/v1/backup/legacy/import") { ctx -> - // TODO + TODO() } // returns a Tachiyomi legacy backup file created from the current database app.get("/api/v1/backup/legacy/export") { ctx -> ctx.contentType("application/json") ctx.result( - future { - createBackup( - BackupFlags( - includeManga = true, - includeCategories = true, - includeChapters = true, - includeTracking = true, - includeHistory = true, - ) + future { + createBackup( + BackupFlags( + includeManga = true, + includeCategories = true, + includeChapters = true, + includeTracking = true, + includeHistory = true, ) - } + ) + } ) } }