Update libraries, some lints (#4099)
* Update some plugins * Fix some miscellaneous lints
This commit is contained in:
@@ -185,7 +185,7 @@ open class ExtensionController :
|
||||
}
|
||||
|
||||
private fun drawExtensions() {
|
||||
if (!query.isBlank()) {
|
||||
if (query.isNotBlank()) {
|
||||
adapter?.updateDataSet(
|
||||
extensions.filter {
|
||||
it.extension.name.contains(query, ignoreCase = true)
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ class ExtensionDetailsPresenter(
|
||||
extensionManager.getInstalledExtensionsObservable()
|
||||
.skip(1)
|
||||
.filter { extensions -> extensions.none { it.pkgName == pkgName } }
|
||||
.map { Unit }
|
||||
.map { }
|
||||
.take(1)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeFirst({ view, _ ->
|
||||
|
||||
@@ -97,7 +97,7 @@ class SearchPresenter(
|
||||
val prevMangaChapters = db.getChapters(prevManga).executeAsBlocking()
|
||||
val maxChapterRead = prevMangaChapters
|
||||
.filter { it.read }
|
||||
.maxBy { it.chapter_number }?.chapter_number
|
||||
.maxByOrNull { it.chapter_number }?.chapter_number
|
||||
val bookmarkedChapters = prevMangaChapters
|
||||
.filter { it.bookmark && it.isRecognizedNumber }
|
||||
.map { it.chapter_number }
|
||||
|
||||
+2
-2
@@ -27,9 +27,9 @@ class MigrationSourcesPresenter(
|
||||
|
||||
private fun findSourcesWithManga(library: List<Manga>): List<SourceItem> {
|
||||
val header = SelectionHeader()
|
||||
return library.map { it.source }.toSet()
|
||||
return library.asSequence().map { it.source }.toSet()
|
||||
.mapNotNull { if (it != LocalSource.ID) sourceManager.getOrStub(it) else null }
|
||||
.sortedBy { it.name.toLowerCase() }
|
||||
.map { SourceItem(it, header) }
|
||||
.map { SourceItem(it, header) }.toList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.drop
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.flow.onStart
|
||||
import rx.Observable
|
||||
|
||||
+1
-1
@@ -264,7 +264,7 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
searchView.maxWidth = Int.MAX_VALUE
|
||||
|
||||
val query = presenter.query
|
||||
if (!query.isBlank()) {
|
||||
if (query.isNotBlank()) {
|
||||
searchItem.expandActionView()
|
||||
searchView.setQuery(query, true)
|
||||
searchView.clearFocus()
|
||||
|
||||
+3
-3
@@ -52,7 +52,7 @@ import java.util.Date
|
||||
*/
|
||||
open class BrowseSourcePresenter(
|
||||
private val sourceId: Long,
|
||||
private val searchQuery: String? = null,
|
||||
searchQuery: String? = null,
|
||||
private val sourceManager: SourceManager = Injekt.get(),
|
||||
private val db: DatabaseHelper = Injekt.get(),
|
||||
private val prefs: PreferencesHelper = Injekt.get(),
|
||||
@@ -153,9 +153,9 @@ open class BrowseSourcePresenter(
|
||||
pagerSubscription?.let { remove(it) }
|
||||
pagerSubscription = pager.results()
|
||||
.observeOn(Schedulers.io())
|
||||
.map { pair -> pair.first to pair.second.map { networkToLocalManga(it, sourceId) } }
|
||||
.map { (first, second) -> first to second.map { networkToLocalManga(it, sourceId) } }
|
||||
.doOnNext { initializeMangas(it.second) }
|
||||
.map { pair -> pair.first to pair.second.map { SourceItem(it, sourceDisplayMode) } }
|
||||
.map { (first, second) -> first to second.map { SourceItem(it, sourceDisplayMode) } }
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeReplay(
|
||||
{ view, (page, mangas) ->
|
||||
|
||||
+1
-1
@@ -195,7 +195,7 @@ open class GlobalSearchController(
|
||||
|
||||
adapter?.updateDataSet(searchResult)
|
||||
|
||||
val progress = searchResult.mapNotNull { it.results }.count().toDouble() / searchResult.size
|
||||
val progress = searchResult.mapNotNull { it.results }.size.toDouble() / searchResult.size
|
||||
if (progress < 1) {
|
||||
binding.progressBar.isVisible = true
|
||||
binding.progressBar.progress = (progress * 100).toInt()
|
||||
|
||||
+2
-3
@@ -222,9 +222,8 @@ open class GlobalSearchPresenter(
|
||||
private fun initializeFetchImageSubscription() {
|
||||
fetchImageSubscription?.unsubscribe()
|
||||
fetchImageSubscription = fetchImageSubject.observeOn(Schedulers.io())
|
||||
.flatMap { pair ->
|
||||
val source = pair.second
|
||||
Observable.from(pair.first).filter { it.thumbnail_url == null && !it.initialized }
|
||||
.flatMap { (first, source) ->
|
||||
Observable.from(first).filter { it.thumbnail_url == null && !it.initialized }
|
||||
.map { Pair(it, source) }
|
||||
.concatMap { getMangaDetailsObservable(it.first, it.second) }
|
||||
.map { Pair(source as CatalogueSource, it) }
|
||||
|
||||
Reference in New Issue
Block a user