From 8ffc21113bfd75f683dfd444cf38147337ac9053 Mon Sep 17 00:00:00 2001 From: Samfun75 <38332931+Samfun75@users.noreply.github.com> Date: Wed, 31 Jan 2024 17:26:05 +0300 Subject: [PATCH] fix(all/yomiroll): Make pref subtitle show up first in case app can't determine locale (#2850) --- src/all/kamyroll/build.gradle | 2 +- .../animeextension/all/kamyroll/Yomiroll.kt | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/all/kamyroll/build.gradle b/src/all/kamyroll/build.gradle index 44eebf023e..c98a9f3dfc 100644 --- a/src/all/kamyroll/build.gradle +++ b/src/all/kamyroll/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Yomiroll' extClass = '.Yomiroll' - extVersionCode = 29 + extVersionCode = 30 } apply from: "$rootDir/common.gradle" diff --git a/src/all/kamyroll/src/eu/kanade/tachiyomi/animeextension/all/kamyroll/Yomiroll.kt b/src/all/kamyroll/src/eu/kanade/tachiyomi/animeextension/all/kamyroll/Yomiroll.kt index 072ef88a31..89b1f79888 100644 --- a/src/all/kamyroll/src/eu/kanade/tachiyomi/animeextension/all/kamyroll/Yomiroll.kt +++ b/src/all/kamyroll/src/eu/kanade/tachiyomi/animeextension/all/kamyroll/Yomiroll.kt @@ -188,7 +188,8 @@ class Yomiroll : ConfigurableAnimeSource, AnimeHttpSource() { return info.data.first().toSAnimeOrNull(anime) ?: anime } - override fun animeDetailsParse(response: Response): SAnime = throw UnsupportedOperationException() + override fun animeDetailsParse(response: Response): SAnime = + throw UnsupportedOperationException() // ============================== Episodes ============================== @@ -287,10 +288,8 @@ class Yomiroll : ConfigurableAnimeSource, AnimeHttpSource() { val sub = json.decodeFromString(value.jsonObject.toString()) Track(sub.url, sub.locale.getLocale()) }?.sortedWith( - compareBy( - { it.lang }, - { it.lang.contains(subLocale) }, - ), + compareByDescending { it.lang.contains(subLocale) } + .thenBy { it.lang }, ) }.getOrNull() ?: emptyList() @@ -355,7 +354,6 @@ class Yomiroll : ConfigurableAnimeSource, AnimeHttpSource() { Pair("en-IN", "English (India)"), Pair("es-419", "Spanish (América Latina)"), Pair("es-ES", "Spanish (España)"), - Pair("es-LA", "Spanish (América Latina)"), Pair("fr-FR", "French"), Pair("ja-JP", "Japanese"), Pair("hi-IN", "Hindi"), @@ -415,7 +413,7 @@ class Yomiroll : ConfigurableAnimeSource, AnimeHttpSource() { } } ?: SAnime.UNKNOWN author = content_provider - description = anime?.description ?: StringBuilder().apply { + description = StringBuilder().apply { appendLine(this@toSAnime.description) appendLine()