Skip to content

Commit

Permalink
Merge branch 'gedoor:master' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
LM-Firefly authored Mar 27, 2024
2 parents cc09b30 + 1e579d2 commit 467de99
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,9 @@ class ChangeBookSourceDialog() : BaseDialogFragment(R.layout.dialog_book_change_
}
upGroupMenuName()
lifecycleScope.launch(IO) {
viewModel.stopSearch()
if (viewModel.refresh()) {
viewModel.startOrStopSearch()
viewModel.startSearch()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ open class ChangeBookSourceViewModel(application: Application) : BaseViewModel(a
fun startSearch() {
execute {
stopSearch()
appDb.searchBookDao.clear(name, author)
searchBooks.clear()
if (searchBooks.isNotEmpty()) {
appDb.searchBookDao.delete(*searchBooks.toTypedArray())
searchBooks.clear()
}
searchCallback?.upAdapter()
bookSourceParts.clear()
val searchGroup = AppConfig.searchGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import io.legado.app.utils.startActivity
import io.legado.app.utils.toastOnUi
import io.legado.app.utils.viewbindingdelegate.viewBinding
import io.legado.app.utils.visible
import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.conflate
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -282,8 +283,12 @@ class ChangeChapterSourceDialog() : BaseDialogFragment(R.layout.dialog_chapter_c
} else {
AppConfig.searchGroup = item.title.toString()
}
viewModel.startOrStopSearch()
viewModel.refresh()
lifecycleScope.launch(IO) {
viewModel.stopSearch()
if (viewModel.refresh()) {
viewModel.startSearch()
}
}
}
}
return false
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/io/legado/app/utils/ChineseUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ object ChineseUtils {
val dict = DictionaryContainer.getInstance().getDictionary(TransType.TRADITIONAL_TO_SIMPLE)
dict.run {
remove("", "", "")
remove("支援", "沈默", "類比", "模擬", "划槳", "列根", "先進")
remove("路易斯", "非同步", "出租车", "周杰倫")
remove("支援", "沈默", "類比", "模擬", "划槳", "列根", "先進", "雪梨", "雪糕")
remove("零錢", "零钱", "離線", "碟片")
remove("路易斯", "非同步", "出租车", "周杰倫", "马铃薯", "馬鈴薯")
}
}

Expand Down

0 comments on commit 467de99

Please sign in to comment.