|
|
@ -12,7 +12,7 @@ object DefaultData { |
|
|
|
const val httpTtsFileName = "httpTTS.json" |
|
|
|
const val httpTtsFileName = "httpTTS.json" |
|
|
|
const val txtTocRuleFileName = "txtTocRule.json" |
|
|
|
const val txtTocRuleFileName = "txtTocRule.json" |
|
|
|
|
|
|
|
|
|
|
|
val defaultHttpTTS by lazy { |
|
|
|
val httpTTS by lazy { |
|
|
|
val json = |
|
|
|
val json = |
|
|
|
String( |
|
|
|
String( |
|
|
|
App.INSTANCE.assets.open("defaultData${File.separator}$httpTtsFileName") |
|
|
|
App.INSTANCE.assets.open("defaultData${File.separator}$httpTtsFileName") |
|
|
@ -21,7 +21,7 @@ object DefaultData { |
|
|
|
GSON.fromJsonArray<HttpTTS>(json)!! |
|
|
|
GSON.fromJsonArray<HttpTTS>(json)!! |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
val defaultReadConfigs by lazy { |
|
|
|
val readConfigs by lazy { |
|
|
|
val json = String( |
|
|
|
val json = String( |
|
|
|
App.INSTANCE.assets.open("defaultData${File.separator}${ReadBookConfig.configFileName}") |
|
|
|
App.INSTANCE.assets.open("defaultData${File.separator}${ReadBookConfig.configFileName}") |
|
|
|
.readBytes() |
|
|
|
.readBytes() |
|
|
@ -29,7 +29,7 @@ object DefaultData { |
|
|
|
GSON.fromJsonArray<ReadBookConfig.Config>(json)!! |
|
|
|
GSON.fromJsonArray<ReadBookConfig.Config>(json)!! |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
val defaultTxtTocRules by lazy { |
|
|
|
val txtTocRules by lazy { |
|
|
|
val json = String( |
|
|
|
val json = String( |
|
|
|
App.INSTANCE.assets.open("defaultData${File.separator}$txtTocRuleFileName") |
|
|
|
App.INSTANCE.assets.open("defaultData${File.separator}$txtTocRuleFileName") |
|
|
|
.readBytes() |
|
|
|
.readBytes() |
|
|
@ -37,11 +37,18 @@ object DefaultData { |
|
|
|
GSON.fromJsonArray<TxtTocRule>(json)!! |
|
|
|
GSON.fromJsonArray<TxtTocRule>(json)!! |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
val defaultThemeConfigs by lazy { |
|
|
|
val themeConfigs by lazy { |
|
|
|
val json = String( |
|
|
|
val json = String( |
|
|
|
App.INSTANCE.assets.open("defaultData${File.separator}${ThemeConfig.configFileName}") |
|
|
|
App.INSTANCE.assets.open("defaultData${File.separator}${ThemeConfig.configFileName}") |
|
|
|
.readBytes() |
|
|
|
.readBytes() |
|
|
|
) |
|
|
|
) |
|
|
|
GSON.fromJsonArray<ThemeConfig.Config>(json)!! |
|
|
|
GSON.fromJsonArray<ThemeConfig.Config>(json)!! |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun importDefaultTocRules() { |
|
|
|
|
|
|
|
App.db.txtTocRule().deleteDefault() |
|
|
|
|
|
|
|
txtTocRules.let { |
|
|
|
|
|
|
|
App.db.txtTocRule().insert(*it.toTypedArray()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |