|
@@ -73,10 +73,11 @@ object Restore {
|
|
|
fileToListT<BookSource>(path, "bookSource.json")?.let {
|
|
fileToListT<BookSource>(path, "bookSource.json")?.let {
|
|
|
appDb.bookSourceDao.insert(*it.toTypedArray())
|
|
appDb.bookSourceDao.insert(*it.toTypedArray())
|
|
|
} ?: run {
|
|
} ?: 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 {
|
|
fileToListT<RssSource>(path, "rssSources.json")?.let {
|
|
|
appDb.rssSourceDao.insert(*it.toTypedArray())
|
|
appDb.rssSourceDao.insert(*it.toTypedArray())
|