diff --git a/app/src/main/java/io/legado/app/data/entities/SearchBook.kt b/app/src/main/java/io/legado/app/data/entities/SearchBook.kt index de3466580..2baf259e4 100644 --- a/app/src/main/java/io/legado/app/data/entities/SearchBook.kt +++ b/app/src/main/java/io/legado/app/data/entities/SearchBook.kt @@ -90,6 +90,15 @@ data class SearchBook( origins?.add(origin) } + fun getDisplayLastChapterTitle(): String { + latestChapterTitle?.let { + if (it.isNotEmpty()) { + return it + } + } + return "无最新章节" + } + fun toBook(): Book { return Book( name = name, diff --git a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceAdapter.kt b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceAdapter.kt index b9292cace..957213945 100644 --- a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceAdapter.kt @@ -19,7 +19,7 @@ class ChangeSourceAdapter(context: Context, val callBack: CallBack) : if (payloads.isEmpty()) { this.onClick { callBack.changeTo(item) } tv_origin.text = item.originName - tv_last.text = item.latestChapterTitle + tv_last.text = item.getDisplayLastChapterTitle() if (callBack.bookUrl == item.bookUrl) { iv_checked.visible() } else { @@ -27,7 +27,7 @@ class ChangeSourceAdapter(context: Context, val callBack: CallBack) : } } else { tv_origin.text = item.originName - tv_last.text = item.latestChapterTitle + tv_last.text = item.getDisplayLastChapterTitle() } } }