Minor fixes
This commit is contained in:
@@ -60,7 +60,6 @@ Additional features for some extensions, features include custom description, op
|
||||
* Mangadex
|
||||
* NHentai
|
||||
* Puruin
|
||||
* Tsumino
|
||||
* LANraragi
|
||||
|
||||
## Download
|
||||
|
||||
@@ -529,7 +529,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 <--
|
||||
)
|
||||
@@ -824,7 +824,7 @@ 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 <--
|
||||
)
|
||||
|
||||
@@ -17,7 +17,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
|
||||
@@ -25,8 +24,6 @@ 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
|
||||
@@ -49,7 +46,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
|
||||
@@ -59,11 +56,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.id == EXH_SOURCE_ID || source.id == EH_SOURCE_ID) {
|
||||
border = if (sourceId == EXH_SOURCE_ID || sourceId == EH_SOURCE_ID) {
|
||||
when (it.type) {
|
||||
EHentaiSearchMetadata.TAG_TYPE_NORMAL -> 2
|
||||
EHentaiSearchMetadata.TAG_TYPE_LIGHT -> 1
|
||||
@@ -178,7 +175,6 @@ fun TagsChip(
|
||||
fun NamespaceTagsPreview() {
|
||||
TachiyomiPreviewTheme {
|
||||
Surface {
|
||||
val context = LocalContext.current
|
||||
NamespaceTags(
|
||||
tags = remember {
|
||||
EHentaiSearchMetadata().apply {
|
||||
@@ -216,7 +212,7 @@ fun NamespaceTagsPreview() {
|
||||
),
|
||||
),
|
||||
)
|
||||
}.let { SearchMetadataChips(it, EHentai(EXH_SOURCE_ID, true, context), emptyList()) }!!
|
||||
}.let { SearchMetadataChips(it, EXH_SOURCE_ID, emptyList()) }!!
|
||||
},
|
||||
onClick = {},
|
||||
)
|
||||
|
||||
@@ -6,6 +6,7 @@ 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.lanraragiSourceIds
|
||||
import exh.source.mangaDexSourceIds
|
||||
import exh.source.nHentaiSourceIds
|
||||
import java.util.Locale
|
||||
@@ -23,7 +24,8 @@ object SourceTagsUtil {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user