Skip to content

Commit

Permalink
fix(all/yomiroll): Make pref subtitle show up first in case app can't…
Browse files Browse the repository at this point in the history
… determine locale (#2850)
  • Loading branch information
Samfun75 authored Jan 31, 2024
1 parent d058cd7 commit 8ffc211
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/all/kamyroll/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Yomiroll'
extClass = '.Yomiroll'
extVersionCode = 29
extVersionCode = 30
}

apply from: "$rootDir/common.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -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 ==============================

Expand Down Expand Up @@ -287,10 +288,8 @@ class Yomiroll : ConfigurableAnimeSource, AnimeHttpSource() {
val sub = json.decodeFromString<Subtitle>(value.jsonObject.toString())
Track(sub.url, sub.locale.getLocale())
}?.sortedWith(
compareBy(
{ it.lang },
{ it.lang.contains(subLocale) },
),
compareByDescending<Track> { it.lang.contains(subLocale) }
.thenBy { it.lang },
)
}.getOrNull() ?: emptyList()

Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 8ffc211

Please sign in to comment.