From dc5f09243ad08f6f13273852e24a8741b1cac7f5 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 29 Oct 2021 10:54:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/model/webBook/SearchModel.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/model/webBook/SearchModel.kt b/app/src/main/java/io/legado/app/model/webBook/SearchModel.kt index 8a3fe58a3..2ff2ccc59 100644 --- a/app/src/main/java/io/legado/app/model/webBook/SearchModel.kt +++ b/app/src/main/java/io/legado/app/model/webBook/SearchModel.kt @@ -56,7 +56,12 @@ class SearchModel(private val scope: CoroutineScope, private val callBack: CallB if (searchGroup.isBlank()) { bookSourceList.addAll(appDb.bookSourceDao.allEnabled) } else { - bookSourceList.addAll(appDb.bookSourceDao.getEnabledByGroup(searchGroup)) + val sources = appDb.bookSourceDao.getEnabledByGroup(searchGroup) + if (sources.isEmpty()) { + bookSourceList.addAll(appDb.bookSourceDao.allEnabled) + } else { + bookSourceList.addAll(sources) + } } } else { searchPage++