fix: 本地导入没有包含在数组内的单个书源时无法解析
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
* 一些带有搜索框的界面自动隐藏软键盘
|
* 一些带有搜索框的界面自动隐藏软键盘
|
||||||
* 本地书籍和远程书籍导入界面支持压缩包
|
* 本地书籍和远程书籍导入界面支持压缩包
|
||||||
* 内置了两个直链上传配置,可以通过导入默认切换
|
* 内置了两个直链上传配置,可以通过导入默认切换
|
||||||
|
* 修复无法导入不在数组内的单个书源的本地文件
|
||||||
|
|
||||||
**2023/03/14**
|
**2023/03/14**
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ object SourceAnalyzer {
|
|||||||
val bookSources = mutableListOf<BookSource>()
|
val bookSources = mutableListOf<BookSource>()
|
||||||
val documentContext = jsonPath.parse(inputStream)
|
val documentContext = jsonPath.parse(inputStream)
|
||||||
kotlin.runCatching {
|
kotlin.runCatching {
|
||||||
val items: List<Map<String, Any> = documentContext.read("$")
|
val items: List<Map<String, Any>> = documentContext.read("$")
|
||||||
for (item in items) {
|
for (item in items) {
|
||||||
val jsonItem = jsonPath.parse(item)
|
val jsonItem = jsonPath.parse(item)
|
||||||
jsonToBookSource(jsonItem.jsonString()).getOrThrow().let {
|
jsonToBookSource(jsonItem.jsonString()).getOrThrow().let {
|
||||||
|
|||||||
Reference in New Issue
Block a user