mirror of
https://github.com/recloudstream/cloudstream.git
synced 2026-07-13 00:13:17 +00:00
Compare commits
1 commit
master
...
fixsortsub
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
daf5d94d5a |
1 changed files with 7 additions and 1 deletions
|
|
@ -365,8 +365,14 @@ object AppContextUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/** Sort subtitles by names */
|
||||
fun sortSubs(subs: Set<SubtitleData>): List<SubtitleData> {
|
||||
return subs.sortedBy { it.name }
|
||||
// Be aware, sorting by "$originalName $nameSuffix" causes "a (b) 1" < "a 1",
|
||||
// where "originalName then nameSuffix" preserves "a 1" < "a (b) 1", because we do not compare '(' and '1'.
|
||||
return subs
|
||||
.sortedWith(
|
||||
compareBy { subtitle: SubtitleData -> subtitle.originalName }
|
||||
.thenBy { subtitle: SubtitleData -> subtitle.nameSuffix })
|
||||
}
|
||||
|
||||
fun Context.getApiSettings(): HashSet<String> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue