|
|
@ -17,12 +17,12 @@ object OldRule { |
|
|
|
fun jsonToBookSource(json: String): BookSource? { |
|
|
|
fun jsonToBookSource(json: String): BookSource? { |
|
|
|
var source: BookSource? = null |
|
|
|
var source: BookSource? = null |
|
|
|
runCatching { |
|
|
|
runCatching { |
|
|
|
source = GSON.fromJsonObject<BookSource>(json) |
|
|
|
source = GSON.fromJsonObject<BookSource>(json.trim()) |
|
|
|
} |
|
|
|
} |
|
|
|
runCatching { |
|
|
|
runCatching { |
|
|
|
if (source == null || source?.searchUrl.isNullOrBlank()) { |
|
|
|
if (source == null || source?.searchUrl.isNullOrBlank()) { |
|
|
|
source = BookSource().apply { |
|
|
|
source = BookSource().apply { |
|
|
|
val jsonItem = jsonPath.parse(json) |
|
|
|
val jsonItem = jsonPath.parse(json.trim()) |
|
|
|
bookSourceUrl = jsonItem.readString("bookSourceUrl") ?: "" |
|
|
|
bookSourceUrl = jsonItem.readString("bookSourceUrl") ?: "" |
|
|
|
bookSourceName = jsonItem.readString("bookSourceName") ?: "" |
|
|
|
bookSourceName = jsonItem.readString("bookSourceName") ?: "" |
|
|
|
bookSourceGroup = jsonItem.readString("bookSourceGroup") ?: "" |
|
|
|
bookSourceGroup = jsonItem.readString("bookSourceGroup") ?: "" |
|
|
|