Skip unsupported sources in global search

(cherry picked from commit d6887e2d75)
master
Koitharu 2 years ago
parent 971c683746
commit 91e3d2f5db
Signed by: Koitharu
GPG Key ID: 676DEE768C17A9D7

@ -113,10 +113,14 @@ class MultiSearchViewModel @Inject constructor(
}
val semaphore = Semaphore(MAX_PARALLELISM)
for (source in sources) {
val repository = mangaRepositoryFactory.create(source)
if (!repository.isSearchSupported) {
continue
}
launch {
val item = runCatchingCancellable {
semaphore.withPermit {
mangaRepositoryFactory.create(source).getList(offset = 0, filter = MangaListFilter.Search(q))
repository.getList(offset = 0, filter = MangaListFilter.Search(q))
.toUi(ListMode.GRID, extraProvider)
}
}.fold(

Loading…
Cancel
Save