优化
This commit is contained in:
@@ -73,10 +73,11 @@ object Restore {
|
||||
fileToListT<BookSource>(path, "bookSource.json")?.let {
|
||||
appDb.bookSourceDao.insert(*it.toTypedArray())
|
||||
} ?: run {
|
||||
val bookSourceFile =
|
||||
FileUtils.createFileIfNotExist(path + File.separator + "bookSource.json")
|
||||
val json = bookSourceFile.readText()
|
||||
ImportOldData.importOldSource(json)
|
||||
val bookSourceFile = File(path, "bookSource.json")
|
||||
if (bookSourceFile.exists()) {
|
||||
val json = bookSourceFile.readText()
|
||||
ImportOldData.importOldSource(json)
|
||||
}
|
||||
}
|
||||
fileToListT<RssSource>(path, "rssSources.json")?.let {
|
||||
appDb.rssSourceDao.insert(*it.toTypedArray())
|
||||
|
||||
Reference in New Issue
Block a user