备份txt目录规则

pull/306/head
gedoor 4 years ago
parent 9a98bc0a8d
commit 89d4ab5b66
  1. 2
      app/src/main/java/io/legado/app/help/storage/Backup.kt
  2. 3
      app/src/main/java/io/legado/app/help/storage/Restore.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)

@ -131,6 +131,9 @@ object Restore {
fileToListT<ReplaceRule>(path, "replaceRule.json")?.let {
App.db.replaceRuleDao().insert(*it.toTypedArray())
}
fileToListT<TxtTocRule>(path, "txtTocRule.json")?.let {
App.db.txtTocRule().insert(*it.toTypedArray())
}
}
}

Loading…
Cancel
Save