fix: 本地导入没有包含在数组内的单个书源时无法解析

This commit is contained in:
Xwite
2023-03-18 09:17:06 +08:00
parent 6793aadbe1
commit 4258c4c0a4
2 changed files with 2 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
* 一些带有搜索框的界面自动隐藏软键盘
* 本地书籍和远程书籍导入界面支持压缩包
* 内置了两个直链上传配置,可以通过导入默认切换
* 修复无法导入不在数组内的单个书源的本地文件
**2023/03/14**

View File

@@ -51,7 +51,7 @@ object SourceAnalyzer {
val bookSources = mutableListOf<BookSource>()
val documentContext = jsonPath.parse(inputStream)
kotlin.runCatching {
val items: List<Map<String, Any> = documentContext.read("$")
val items: List<Map<String, Any>> = documentContext.read("$")
for (item in items) {
val jsonItem = jsonPath.parse(item)
jsonToBookSource(jsonItem.jsonString()).getOrThrow().let {