Improve in case source is null (#801)

related to commit 343cd372
This commit is contained in:
Cuong-Tran 2025-03-27 23:47:12 +07:00 committed by GitHub
parent cc375e28e3
commit 48eb78ec0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 7 deletions

View file

@ -6,12 +6,13 @@ import cafe.adriel.voyager.navigator.currentOrThrow
import eu.kanade.presentation.browse.BrowseTabWrapper
import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.ui.manga.MangaScreen
import exh.recs.BrowseRecommendsScreen
import exh.recs.RecommendsScreen
import java.io.Serializable
/**
* Navigated to when invoking [MangaScreen.openSmartSearch] for entries to merge or
* from [RecommendsScreen.openSmartSearch] for click a recommendation entry.
* from [RecommendsScreen], [BrowseRecommendsScreen] for click a recommendation entry.
* This will show a [sourcesTab] to select a source to search for entries to merge or
* search for recommending entry.
*/

View file

@ -10,22 +10,31 @@ import exh.metadata.metadata.RaisedSearchMetadata
import tachiyomi.core.common.util.lang.withIOContext
import tachiyomi.domain.source.repository.SourcePagingSourceType
class SourceSearchPagingSource(/* KMK --> */ override val /* KMK <-- */source: CatalogueSource, val query: String, val filters: FilterList) :
class SourceSearchPagingSource(source: CatalogueSource, val query: String, val filters: FilterList) :
SourcePagingSource(source) {
override suspend fun requestNextPage(currentPage: Int): MangasPage {
return source.getSearchManga(currentPage, query, filters)
return source?.getSearchManga(currentPage, query, filters)
// KMK -->
?: MangasPage(emptyList(), false)
// KMK <--
}
}
class SourcePopularPagingSource(/* KMK --> */ override val /* KMK <-- */source: CatalogueSource) : SourcePagingSource(source) {
class SourcePopularPagingSource(source: CatalogueSource) : SourcePagingSource(source) {
override suspend fun requestNextPage(currentPage: Int): MangasPage {
return source.getPopularManga(currentPage)
return source?.getPopularManga(currentPage)
// KMK -->
?: MangasPage(emptyList(), false)
// KMK <--
}
}
class SourceLatestPagingSource(/* KMK --> */ override val /* KMK <-- */source: CatalogueSource) : SourcePagingSource(source) {
class SourceLatestPagingSource(source: CatalogueSource) : SourcePagingSource(source) {
override suspend fun requestNextPage(currentPage: Int): MangasPage {
return source.getLatestUpdates(currentPage)
return source?.getLatestUpdates(currentPage)
// KMK -->
?: MangasPage(emptyList(), false)
// KMK <--
}
}