Minor cleanup
This commit is contained in:
parent
07e28ca5c2
commit
2bb9e596ba
@ -166,7 +166,13 @@ class LibraryCategoryAdapter(view: LibraryCategoryView, val controller: LibraryC
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun filterManga(queries: List<QueryComponent>, manga: LibraryManga, checkGenre: Boolean = true, searchTags: List<SearchTag>? = null, searchTitles: List<SearchTitle>? = null): Boolean {
|
||||
private fun filterManga(
|
||||
queries: List<QueryComponent>,
|
||||
manga: LibraryManga,
|
||||
checkGenre: Boolean = true,
|
||||
searchTags: List<SearchTag>? = null,
|
||||
searchTitles: List<SearchTitle>? = null
|
||||
): Boolean {
|
||||
val mappedQueries = queries.groupBy { it.excluded }
|
||||
val tracks = if (hasLoggedServices) db.getTracks(manga).executeAsBlocking().toList() else null
|
||||
val source = sourceManager.get(manga.source)
|
||||
|
@ -1,10 +1,8 @@
|
||||
package eu.kanade.tachiyomi.ui.library
|
||||
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import coil.clear
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.davidea.flexibleadapter.items.IFlexible
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.databinding.SourceComfortableGridItemBinding
|
||||
import eu.kanade.tachiyomi.util.view.loadAnyAutoPause
|
||||
@ -23,7 +21,7 @@ import reactivecircus.flowbinding.android.view.clicks
|
||||
*/
|
||||
class LibraryComfortableGridHolder(
|
||||
override val binding: SourceComfortableGridItemBinding,
|
||||
adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>
|
||||
adapter: FlexibleAdapter<*>
|
||||
) : LibraryHolder<SourceComfortableGridItemBinding>(binding.root, adapter) {
|
||||
|
||||
// SY -->
|
||||
|
@ -2,11 +2,9 @@ package eu.kanade.tachiyomi.ui.library
|
||||
|
||||
import android.view.View
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import coil.clear
|
||||
import coil.loadAny
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.davidea.flexibleadapter.items.IFlexible
|
||||
import eu.kanade.tachiyomi.databinding.SourceListItemBinding
|
||||
|
||||
/**
|
||||
@ -20,9 +18,7 @@ import eu.kanade.tachiyomi.databinding.SourceListItemBinding
|
||||
*/
|
||||
class LibraryListHolder(
|
||||
private val view: View,
|
||||
// SY -->
|
||||
adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>
|
||||
// SY <--
|
||||
adapter: FlexibleAdapter<*>
|
||||
) : LibraryHolder<SourceListItemBinding>(view, adapter) {
|
||||
|
||||
override val binding = SourceListItemBinding.bind(view)
|
||||
|
@ -110,7 +110,7 @@ class ChaptersSettingsSheet(
|
||||
override fun onItemClicked(item: Item) {
|
||||
if (item is Item.DrawableSelection) {
|
||||
val scanlators = presenter.allChapterScanlators.toTypedArray()
|
||||
val filteredScanlators = presenter.manga.filtered_scanlators?.let { MdUtil.getScanlators(it) } ?: scanlators.toSet()
|
||||
val filteredScanlators = presenter.manga.filtered_scanlators?.let(MdUtil::getScanlators) ?: scanlators.toSet()
|
||||
val selection = scanlators.map {
|
||||
it in filteredScanlators
|
||||
}.toBooleanArray()
|
||||
|
@ -314,7 +314,7 @@ class MangaInfoHeaderAdapter(
|
||||
.filterNot { it in listOf("all", "other") }
|
||||
|
||||
// SY -->
|
||||
val isMergedSource = source?.id == MERGED_SOURCE_ID
|
||||
val isMergedSource = source.id == MERGED_SOURCE_ID
|
||||
// SY <--
|
||||
val hasOneActiveLanguages = enabledLanguages.size == 1
|
||||
val isInEnabledLanguages = source.lang in enabledLanguages
|
||||
|
Loading…
x
Reference in New Issue
Block a user