Fix global search

This commit is contained in:
Koitharu
2020-07-12 13:48:12 +03:00
parent d363869dab
commit 626bb20edb
2 changed files with 7 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ android {
minSdkVersion 21
targetSdkVersion 29
versionCode gitCommits
versionName '0.5-rc2'
versionName '0.5-rc3'
kapt {
arguments {

View File

@@ -18,7 +18,12 @@ class MangaSearchRepository : KoinComponent {
var isEmitted = false
for (source in sources) {
val list = lists.getOrPut(source) {
MangaProviderFactory.create(source).getList(0, query, SortOrder.POPULARITY)
try {
MangaProviderFactory.create(source).getList(0, query, SortOrder.POPULARITY)
} catch (e: Throwable) {
e.printStackTrace()
emptyList<Manga>()
}
}
if (i < list.size) {
emit(list.subList(i, (i + batchSize).coerceAtMost(list.lastIndex)))