|
|
|
@ -9,7 +9,6 @@ import androidx.compose.ui.unit.dp
|
|
|
|
|
import androidx.paging.Pager
|
|
|
|
|
import androidx.paging.PagingConfig
|
|
|
|
|
import androidx.paging.cachedIn
|
|
|
|
|
import androidx.paging.filter
|
|
|
|
|
import androidx.paging.map
|
|
|
|
|
import cafe.adriel.voyager.core.model.StateScreenModel
|
|
|
|
|
import cafe.adriel.voyager.core.model.coroutineScope
|
|
|
|
@ -32,7 +31,6 @@ import kotlinx.coroutines.flow.emptyFlow
|
|
|
|
|
import kotlinx.coroutines.flow.filter
|
|
|
|
|
import kotlinx.coroutines.flow.filterNotNull
|
|
|
|
|
import kotlinx.coroutines.flow.firstOrNull
|
|
|
|
|
import kotlinx.coroutines.flow.flow
|
|
|
|
|
import kotlinx.coroutines.flow.map
|
|
|
|
|
import kotlinx.coroutines.flow.stateIn
|
|
|
|
|
import kotlinx.coroutines.flow.update
|
|
|
|
@ -41,7 +39,6 @@ import logcat.LogPriority
|
|
|
|
|
import tachiyomi.core.preference.CheckboxState
|
|
|
|
|
import tachiyomi.core.preference.mapAsCheckboxState
|
|
|
|
|
import tachiyomi.core.util.lang.launchIO
|
|
|
|
|
import tachiyomi.core.util.lang.withIOContext
|
|
|
|
|
import tachiyomi.core.util.system.logcat
|
|
|
|
|
import tachiyomi.domain.category.interactor.GetCategories
|
|
|
|
|
import tachiyomi.domain.category.interactor.SetMangaCategories
|
|
|
|
@ -120,7 +117,6 @@ class BrowseSourceScreenModel(
|
|
|
|
|
getRemoteManga.subscribe(sourceId, listing.query ?: "", listing.filters)
|
|
|
|
|
}.flow.map { pagingData ->
|
|
|
|
|
pagingData.map {
|
|
|
|
|
withIOContext {
|
|
|
|
|
networkToLocalManga.await(it.toDomainManga(sourceId))
|
|
|
|
|
.let { localManga ->
|
|
|
|
|
getManga.subscribe(localManga.url, localManga.source)
|
|
|
|
@ -132,7 +128,6 @@ class BrowseSourceScreenModel(
|
|
|
|
|
.stateIn(coroutineScope)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.cachedIn(coroutineScope)
|
|
|
|
|
}
|
|
|
|
|
.stateIn(coroutineScope, SharingStarted.Lazily, emptyFlow())
|
|
|
|
|