Update usages

This commit is contained in:
Jobobby04
2023-10-01 15:56:07 -04:00
parent 68fdd471ac
commit 32a938e6d4
4 changed files with 12 additions and 16 deletions
@@ -26,9 +26,7 @@ import kotlinx.coroutines.flow.receiveAsFlow
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import tachiyomi.core.util.lang.awaitSingle
import tachiyomi.core.util.lang.launchIO
import tachiyomi.core.util.lang.launchNonCancellable
import tachiyomi.core.util.lang.withIOContext
@@ -224,14 +222,14 @@ open class FeedScreenModel(
if (itemUI.source != null) {
withContext(coroutineDispatcher) {
if (itemUI.savedSearch == null) {
itemUI.source.fetchLatestUpdates(1)
itemUI.source.getLatestUpdates(1)
} else {
itemUI.source.fetchSearchManga(
itemUI.source.getSearchManga(
1,
itemUI.savedSearch.query.orEmpty(),
getFilterList(itemUI.savedSearch, itemUI.source),
)
}.awaitSingle()
}
}.mangas
} else {
emptyList()
@@ -154,14 +154,14 @@ open class SourceFeedScreenModel(
val page = try {
withContext(coroutineDispatcher) {
when (sourceFeed) {
is SourceFeedUI.Browse -> source.fetchPopularManga(1)
is SourceFeedUI.Latest -> source.fetchLatestUpdates(1)
is SourceFeedUI.SourceSavedSearch -> source.fetchSearchManga(
is SourceFeedUI.Browse -> source.getPopularManga(1)
is SourceFeedUI.Latest -> source.getLatestUpdates(1)
is SourceFeedUI.SourceSavedSearch -> source.getSearchManga(
page = 1,
query = sourceFeed.savedSearch.query.orEmpty(),
filters = getFilterList(sourceFeed.savedSearch, source),
)
}.awaitSingle()
}
}.mangas
} catch (e: Exception) {
emptyList()