|
|
@ -229,10 +229,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV |
|
|
|
else -> { |
|
|
|
else -> { |
|
|
|
appDb.bookSourceDao.flowSearch("%$searchKey%") |
|
|
|
appDb.bookSourceDao.flowSearch("%$searchKey%") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}.collect { data -> |
|
|
|
}.onFailure { |
|
|
|
|
|
|
|
AppLog.put("更新书源出错", it) |
|
|
|
|
|
|
|
}.getOrNull()?.collect { data -> |
|
|
|
|
|
|
|
val sourceList = |
|
|
|
val sourceList = |
|
|
|
if (sortAscending) when (sort) { |
|
|
|
if (sortAscending) when (sort) { |
|
|
|
Sort.Weight -> data.sortedBy { it.weight } |
|
|
|
Sort.Weight -> data.sortedBy { it.weight } |
|
|
@ -270,6 +267,9 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV |
|
|
|
} |
|
|
|
} |
|
|
|
adapter.setItems(sourceList, adapter.diffItemCallback) |
|
|
|
adapter.setItems(sourceList, adapter.diffItemCallback) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}.onFailure { |
|
|
|
|
|
|
|
AppLog.put("更新书源出错", it) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|