From 89d4ab5b666ff7e6ca7ff4df7fcd40f89eaa93e2 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 12 Aug 2020 15:22:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=BDtxt=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/storage/Backup.kt | 2 ++ app/src/main/java/io/legado/app/help/storage/Restore.kt | 3 +++ 2 files changed, 5 insertions(+) diff --git a/app/src/main/java/io/legado/app/help/storage/Backup.kt b/app/src/main/java/io/legado/app/help/storage/Backup.kt index 0e11042d2..03ea7a84b 100644 --- a/app/src/main/java/io/legado/app/help/storage/Backup.kt +++ b/app/src/main/java/io/legado/app/help/storage/Backup.kt @@ -30,6 +30,7 @@ object Backup { "rssSource.json", "rssStar.json", "replaceRule.json", + "txtTocRule.json", ReadBookConfig.readConfigFileName, "config.xml" ) @@ -55,6 +56,7 @@ object Backup { writeListToJson(App.db.rssSourceDao().all, "rssSource.json", backupPath) writeListToJson(App.db.rssStarDao().all, "rssStar.json", backupPath) writeListToJson(App.db.replaceRuleDao().all, "replaceRule.json", backupPath) + writeListToJson(App.db.txtTocRule().all, "txtTocRule.json", backupPath) GSON.toJson(ReadBookConfig.configList)?.let { FileUtils.createFileIfNotExist(backupPath + File.separator + ReadBookConfig.readConfigFileName) .writeText(it) diff --git a/app/src/main/java/io/legado/app/help/storage/Restore.kt b/app/src/main/java/io/legado/app/help/storage/Restore.kt index c2c527ddd..1b5b1603d 100644 --- a/app/src/main/java/io/legado/app/help/storage/Restore.kt +++ b/app/src/main/java/io/legado/app/help/storage/Restore.kt @@ -131,6 +131,9 @@ object Restore { fileToListT(path, "replaceRule.json")?.let { App.db.replaceRuleDao().insert(*it.toTypedArray()) } + fileToListT(path, "txtTocRule.json")?.let { + App.db.txtTocRule().insert(*it.toTypedArray()) + } } }