export extensions

This commit is contained in:
Aria Moradi 2021-04-02 18:10:02 +04:30
parent b0e90c2f63
commit 47fcf7eb97
2 changed files with 16 additions and 14 deletions

View File

@ -121,6 +121,8 @@ object LegacyBackupExport {
}
}
// TODO the rest
return entry
}
@ -130,8 +132,8 @@ object LegacyBackupExport {
}
private fun backupExtensionInfo(root: JsonArray, extensions: Set<String>) { // TODO
// extensions.sorted().forEach {
// root.add(it)
// }
extensions.sorted().forEach {
root.add(it)
}
}
}

View File

@ -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,
)
}
)
}
)
}
}