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()
@@ -8,7 +8,6 @@ import info.debatty.java.stringsimilarity.NormalizedLevenshtein
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.supervisorScope
import tachiyomi.core.util.lang.awaitSingle
import tachiyomi.domain.manga.model.Manga
import java.util.Locale
@@ -31,7 +30,7 @@ class SmartSearchEngine(
query
}
val searchResults = source.fetchSearchManga(1, builtQuery, FilterList()).awaitSingle()
val searchResults = source.getSearchManga(1, builtQuery, FilterList())
searchResults.mangas.map {
val cleanedMangaTitle = cleanSmartSearchTitle(it.originalTitle)
@@ -54,7 +53,7 @@ class SmartSearchEngine(
} else {
title
}
val searchResults = source.fetchSearchManga(1, searchQuery, FilterList()).awaitSingle()
val searchResults = source.getSearchManga(1, searchQuery, FilterList())
if (searchResults.mangas.size == 1) {
return@supervisorScope listOf(SearchEntry(searchResults.mangas.first(), 0.0))