Minor fixes

(cherry picked from commit b8b468cea7f1d117f54331780d75584bff9cf644)
This commit is contained in:
Jobobby04 2025-12-25 16:49:01 -05:00 committed by Cuong-Tran
parent ad9736a2ba
commit e0340be73c
7 changed files with 18 additions and 23 deletions

View file

@ -125,7 +125,6 @@ Additional features for some extensions, features include custom description, op
* Mangadex
* NHentai
* Puruin
* Tsumino
* LANraragi
</details>

View file

@ -42,7 +42,7 @@ import eu.kanade.presentation.util.animateItemFastScroll
import eu.kanade.tachiyomi.ui.browse.migration.sources.MigrateSourceScreenModel
import eu.kanade.tachiyomi.util.system.copyToClipboard
import exh.source.ExhPreferences
import exh.source.hentaiSourceIds
import exh.source.eHentaiSourceIds
import kotlinx.collections.immutable.ImmutableList
import tachiyomi.domain.source.model.Source
import tachiyomi.i18n.MR
@ -195,7 +195,7 @@ private fun MigrateSourceList(
!filterObsoleteSource ||
(
it.first.installedExtension?.isObsolete != false &&
(!isHentaiEnabled || it.first.id !in hentaiSourceIds)
(!isHentaiEnabled || it.first.id !in eHentaiSourceIds)
)
},
// KMK <--

View file

@ -697,7 +697,7 @@ private fun MangaScreenSmallImpl(
// SY -->
doSearch = onSearch,
searchMetadataChips = remember(state.meta, state.source.id, state.manga.genre) {
SearchMetadataChips(state.meta, state.source, state.manga.genre)
SearchMetadataChips(state.meta, state.source.id, state.manga.genre)
},
// SY <--
)
@ -1133,7 +1133,7 @@ private fun MangaScreenLargeImpl(
// SY -->
doSearch = onSearch,
searchMetadataChips = remember(state.meta, state.source.id, state.manga.genre) {
SearchMetadataChips(state.meta, state.source, state.manga.genre)
SearchMetadataChips(state.meta, state.source.id, state.manga.genre)
},
// SY <--
)

View file

@ -18,7 +18,6 @@ import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
@ -26,13 +25,11 @@ import eu.kanade.presentation.components.ChipBorder
import eu.kanade.presentation.components.SuggestionChip
import eu.kanade.presentation.components.SuggestionChipDefaults
import eu.kanade.presentation.theme.TachiyomiPreviewTheme
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.online.all.EHentai
import exh.metadata.metadata.EHentaiSearchMetadata
import exh.metadata.metadata.RaisedSearchMetadata
import exh.metadata.metadata.base.RaisedTag
import exh.source.EXH_SOURCE_ID
import exh.source.isEhBasedSource
import exh.source.eHentaiSourceIds
import exh.util.SourceTagsUtil
import androidx.compose.material3.SuggestionChipDefaults as SuggestionChipDefaultsM3
@ -50,7 +47,7 @@ value class SearchMetadataChips(
val tags: Map<String, List<DisplayTag>>,
) {
companion object {
operator fun invoke(meta: RaisedSearchMetadata?, source: Source, tags: List<String>?): SearchMetadataChips? {
operator fun invoke(meta: RaisedSearchMetadata?, sourceId: Long, tags: List<String>?): SearchMetadataChips? {
return if (meta != null) {
SearchMetadataChips(
meta.tags
@ -60,11 +57,11 @@ value class SearchMetadataChips(
namespace = it.namespace,
text = it.name,
search = if (!it.namespace.isNullOrEmpty()) {
SourceTagsUtil.getWrappedTag(source.id, namespace = it.namespace, tag = it.name)
SourceTagsUtil.getWrappedTag(sourceId, namespace = it.namespace, tag = it.name)
} else {
SourceTagsUtil.getWrappedTag(source.id, fullTag = it.name)
SourceTagsUtil.getWrappedTag(sourceId, fullTag = it.name)
} ?: it.name,
border = if (source.isEhBasedSource()) {
border = if (sourceId in eHentaiSourceIds) {
when (it.type) {
EHentaiSearchMetadata.TAG_TYPE_NORMAL -> 2
EHentaiSearchMetadata.TAG_TYPE_LIGHT -> 1
@ -235,7 +232,6 @@ fun TagsChip(
fun NamespaceTagsPreview() {
TachiyomiPreviewTheme {
Surface {
val context = LocalContext.current
NamespaceTags(
tags = remember {
EHentaiSearchMetadata().apply {
@ -273,7 +269,7 @@ fun NamespaceTagsPreview() {
),
),
)
}.let { SearchMetadataChips(it, EHentai(EXH_SOURCE_ID, true, context), emptyList()) }!!
}.let { SearchMetadataChips(it, EXH_SOURCE_ID, emptyList()) }!!
},
onClick = {},
)

View file

@ -9,10 +9,10 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import androidx.core.graphics.toColorInt
import exh.metadata.metadata.base.RaisedTag
import exh.source.EH_SOURCE_ID
import exh.source.EXH_SOURCE_ID
import exh.source.PURURIN_SOURCE_ID
import exh.source.TSUMINO_SOURCE_ID
import exh.source.eHentaiSourceIds
import exh.source.lanraragiSourceIds
import exh.source.mangaDexSourceIds
import exh.source.nHentaiSourceIds
import tachiyomi.presentation.core.icons.FlagEmoji.Companion.getEmojiLangFlag
@ -26,12 +26,12 @@ object SourceTagsUtil {
fullTag: String? = null,
): String? {
return if (
sourceId == EXH_SOURCE_ID ||
sourceId == EH_SOURCE_ID ||
sourceId in eHentaiSourceIds ||
sourceId in nHentaiSourceIds ||
sourceId in mangaDexSourceIds ||
sourceId == PURURIN_SOURCE_ID ||
sourceId == TSUMINO_SOURCE_ID
sourceId == TSUMINO_SOURCE_ID ||
sourceId in lanraragiSourceIds
) {
val parsed = when {
fullTag != null -> parseTag(fullTag)

View file

@ -30,13 +30,13 @@ fun isMetadataSource(source: Long) = source in 6900..6999 ||
metadataDelegatedSourceIds.binarySearch(source) >= 0
// KMK -->
fun Source.isEhBasedSource() = this is EhBasedSource && id in hentaiSourceIds
fun Source.isEhBasedSource() = this is EhBasedSource && id in eHentaiSourceIds
// KMK <--
fun Source.isMdBasedSource() = id in mangaDexSourceIds
// KMK -->
fun Manga.isEhBasedManga() = source in hentaiSourceIds
fun Manga.isEhBasedManga() = source in eHentaiSourceIds
// KMK <--
fun Source.getMainSource(): Source = if (this is EnhancedHttpSource) {

View file

@ -71,7 +71,7 @@ val EXHENTAI_EXT_SOURCES = mapOf(
EXH_SOURCE_ID to "all", // E-Hentai (Multi)
)
val hentaiSourceIds = EHENTAI_EXT_SOURCES.keys + EXHENTAI_EXT_SOURCES.keys
val eHentaiSourceIds = EHENTAI_EXT_SOURCES.keys + EXHENTAI_EXT_SOURCES.keys
val COMICK_IDS = setOf(
982606170401027267, // all