From 3a9478db8d2d0bd7f361651f27ff5048958ac49e Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 13 Jul 2019 23:12:17 +0800 Subject: [PATCH] up --- .../java/io/legado/app/model/webbook/BookList.kt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/webbook/BookList.kt b/app/src/main/java/io/legado/app/model/webbook/BookList.kt index c7d616872..2a61e383c 100644 --- a/app/src/main/java/io/legado/app/model/webbook/BookList.kt +++ b/app/src/main/java/io/legado/app/model/webbook/BookList.kt @@ -44,10 +44,17 @@ class BookList { private fun getItem(analyzeRule: AnalyzeRule, bookSource: BookSource): SearchBook? { val searchBook = SearchBook() analyzeRule.setBook(searchBook) - bookSource.getBookInfoRule().init?.let { - analyzeRule.setContent(analyzeRule.getElement(it)) + with(bookSource.getBookInfoRule()) { + init?.let { + analyzeRule.setContent(analyzeRule.getElement(it)) + } + searchBook.name = analyzeRule.getString(name ?: "") + if (!searchBook.name.isNullOrEmpty()) { + searchBook.author = analyzeRule.getString(author ?: "") + searchBook.coverUrl = analyzeRule.getString(coverUrl ?: "") + return searchBook + } } - return null } } \ No newline at end of file