mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-16 14:07:28 +01:00
Minor cleanup
This commit is contained in:
@@ -173,7 +173,7 @@ data class ExtensionDetailsState(
|
||||
) {
|
||||
|
||||
val sources: List<ExtensionSourceItem>
|
||||
get() = _sources ?: emptyList()
|
||||
get() = _sources.orEmpty()
|
||||
|
||||
val isLoading: Boolean
|
||||
get() = extension == null || _sources == null
|
||||
|
||||
@@ -64,7 +64,7 @@ data class MigrateMangaState(
|
||||
) {
|
||||
|
||||
val titles: List<Manga>
|
||||
get() = titleList ?: emptyList()
|
||||
get() = titleList.orEmpty()
|
||||
|
||||
val isLoading: Boolean
|
||||
get() = source == null || titleList == null
|
||||
|
||||
@@ -311,7 +311,7 @@ class BrowseSourceScreenModel(
|
||||
return getCategories.subscribe()
|
||||
.firstOrNull()
|
||||
?.filterNot { it.isSystemCategory }
|
||||
?: emptyList()
|
||||
.orEmpty()
|
||||
}
|
||||
|
||||
suspend fun getDuplicateLibraryManga(manga: Manga): Manga? {
|
||||
|
||||
@@ -355,7 +355,7 @@ class LibraryScreenModel(
|
||||
categories
|
||||
}
|
||||
|
||||
displayCategories.associateWith { libraryManga[it.id] ?: emptyList() }
|
||||
displayCategories.associateWith { libraryManga[it.id].orEmpty() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -700,7 +700,7 @@ class LibraryScreenModel(
|
||||
}
|
||||
|
||||
fun getLibraryItemsByPage(page: Int): List<LibraryItem> {
|
||||
return library.values.toTypedArray().getOrNull(page) ?: emptyList()
|
||||
return library.values.toTypedArray().getOrNull(page).orEmpty()
|
||||
}
|
||||
|
||||
fun getMangaCountForCategory(category: Category): Int? {
|
||||
|
||||
@@ -25,7 +25,8 @@ class DirectoryPageLoader(val file: File) : PageLoader() {
|
||||
stream = streamFn
|
||||
status = Page.State.READY
|
||||
}
|
||||
} ?: emptyList()
|
||||
}
|
||||
.orEmpty()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user