better video quality sorting
This commit is contained in:
parent
8ed3d416da
commit
cee79b69dd
1 changed files with 9 additions and 1 deletions
|
@ -325,8 +325,16 @@ class AniPlay : AniListAnimeHttpSource(), ConfigurableAnimeSource {
|
|||
val lang = preferences.getString(PREF_TYPE_KEY, PREF_TYPE_DEFAULT)!!.let(::getTypeName)
|
||||
val server = preferences.getString(PREF_SERVER_KEY, PREF_SERVER_DEFAULT)!!.let(::getServerName)
|
||||
|
||||
val lang2 = if ((lang == PREF_TYPE_ENTRIES[1]) or (lang == PREF_TYPE_ENTRIES[3])) {
|
||||
// if preferred language is SoftSub or Dubtitles
|
||||
PREF_TYPE_ENTRIES[PREF_TYPE_ENTRIES.indexOf(lang) - 1]
|
||||
} else {
|
||||
""
|
||||
}
|
||||
|
||||
return sortedWith(
|
||||
compareByDescending<Video> { it.quality.contains(lang) }
|
||||
compareByDescending<Video> { it.quality.split(" - ").contains(lang) }
|
||||
.thenByDescending { it.quality.contains(lang2) }
|
||||
.thenByDescending { it.quality.contains(quality) }
|
||||
.thenByDescending { it.quality.contains(server, true) },
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue