Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
cuong-tran committed Feb 5, 2024
2 parents 97efbd2 + e49ff1e commit 20e3b12
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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) },
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/eu/kanade/tachiyomi/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -91,6 +92,7 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory {
@SuppressLint("LaunchActivityFromNotification")
override fun onCreate() {
super<Application>.onCreate()
Firebase.initialize(this)

// SY -->
if (!isDevFlavor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 20e3b12

Please sign in to comment.