From bf250cbc34ca9f413aa2f711402c11172f7dac22 Mon Sep 17 00:00:00 2001 From: "Cuong M. Tran" Date: Mon, 5 Feb 2024 00:29:49 +0700 Subject: [PATCH 1/4] Language tag with current locale in Extension Filter --- .../eu/kanade/presentation/browse/ExtensionFilterScreen.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/presentation/browse/ExtensionFilterScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/ExtensionFilterScreen.kt index c65f0d0b15..4f589955df 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/ExtensionFilterScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/ExtensionFilterScreen.kt @@ -59,7 +59,10 @@ private fun ExtensionFilterContent( items(state.languages) { language -> SwitchPreferenceWidget( modifier = Modifier.animateItemPlacement(), - title = LocaleHelper.getSourceDisplayName(language, context), + title = LocaleHelper.getSourceDisplayName(language, context) + // KMK --> + + " (${LocaleHelper.getDisplayName(language)})", + // KMK <-- checked = language in state.enabledLanguages, onCheckedChanged = { onClickLang(language) }, ) From a4f8a3363106ff017af016b4e1bc16e55f392177 Mon Sep 17 00:00:00 2001 From: "Cuong M. Tran" Date: Mon, 5 Feb 2024 00:33:56 +0700 Subject: [PATCH 2/4] Replace MyAnimeList key with Komikku --- .../kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt index c67cc2a2a5..72cb6d2383 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt @@ -277,8 +277,8 @@ class MyAnimeListApi( } companion object { - // Registered under arkon's MAL account - private const val clientId = "8fd3313bc138e8b890551aa1de1a2589" + // Registered under KMK's MAL account + private const val clientId = "6aa6df85b5f386a4328e01299ad74c75" private const val baseOAuthUrl = "https://myanimelist.net/v1/oauth2" private const val baseApiUrl = "https://api.myanimelist.net/v2" From c166fed426bcb5d7b1b48f0ae0d7a1fe473e08f9 Mon Sep 17 00:00:00 2001 From: "Cuong M. Tran" Date: Tue, 6 Feb 2024 03:10:48 +0700 Subject: [PATCH 3/4] =?UTF-8?q?Show=20source=E2=80=99s=20extension=20name?= =?UTF-8?q?=20in=20Source=20browse=20&=20Global=20search?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (often it’s a romanized version so it’s easier to remember) --- .../presentation/browse/GlobalSearchScreen.kt | 20 +++++++++++++++++-- .../browse/components/BaseSourceItem.kt | 7 ++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt index 0ea1adf2ef..80e13f03c2 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt @@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.runtime.Composable import androidx.compose.runtime.State +import eu.kanade.domain.source.model.installedExtension import eu.kanade.presentation.browse.components.GlobalSearchCardRow import eu.kanade.presentation.browse.components.GlobalSearchErrorResultItem import eu.kanade.presentation.browse.components.GlobalSearchLoadingResultItem @@ -16,6 +17,7 @@ import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SourceFilter import eu.kanade.tachiyomi.util.system.LocaleHelper import kotlinx.collections.immutable.ImmutableMap import tachiyomi.domain.manga.model.Manga +import tachiyomi.domain.source.model.Source as DomainSource import tachiyomi.presentation.core.components.material.Scaffold @Composable @@ -74,10 +76,24 @@ internal fun GlobalSearchContent( ) { items.forEach { (source, result) -> item(key = source.id) { + // KMK --> + val domainSource = DomainSource( + source.id, + "", "", + supportsLatest = false, + isStub = false + ) + // KMK <-- + GlobalSearchResultItem( - title = fromSourceId?.let { + title = (fromSourceId?.let { "▶ ${source.name}".takeIf { source.id == fromSourceId } - } ?: source.name, + } ?: source.name) + + // KMK --> + (domainSource.installedExtension?.let { extension -> + " (${extension.name})".takeIf { extension.name != source.name } + } ?: ""), + // KMK <-- subtitle = LocaleHelper.getLocalizedDisplayName(source.lang), onClick = { onClickSource(source) }, ) { diff --git a/app/src/main/java/eu/kanade/presentation/browse/components/BaseSourceItem.kt b/app/src/main/java/eu/kanade/presentation/browse/components/BaseSourceItem.kt index 951fb307bc..32e14da082 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/components/BaseSourceItem.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/components/BaseSourceItem.kt @@ -55,7 +55,12 @@ private val defaultContent: @Composable RowScope.(Source, String?) -> Unit = { s .weight(1f), ) { Text( - text = source.name, + text = source.name + + // KMK --> + (source.installedExtension?.let { extension -> + " (${extension.name})".takeIf {extension.name != source.name } + } ?: ""), + // KMK <-- maxLines = 1, overflow = TextOverflow.Ellipsis, style = MaterialTheme.typography.bodyMedium, From e49ff1e137ee53c7bb2e55360e5ef8d4fc747126 Mon Sep 17 00:00:00 2001 From: "Cuong M. Tran" Date: Tue, 6 Feb 2024 04:33:59 +0700 Subject: [PATCH 4/4] initialize FirebaseApp --- app/src/main/java/eu/kanade/tachiyomi/App.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index fe34d8550c..4296dd3c27 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -30,6 +30,7 @@ import com.elvishew.xlog.printer.file.backup.NeverBackupStrategy import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator import com.google.firebase.crashlytics.ktx.crashlytics import com.google.firebase.ktx.Firebase +import com.google.firebase.ktx.initialize import eu.kanade.domain.DomainModule import eu.kanade.domain.SYDomainModule import eu.kanade.domain.base.BasePreferences @@ -91,6 +92,7 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory { @SuppressLint("LaunchActivityFromNotification") override fun onCreate() { super.onCreate() + Firebase.initialize(this) // SY --> if (!isDevFlavor) {