mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Added sort function for subtitles by their locale
This commit is contained in:
parent
3285d458be
commit
bd19b34088
1 changed files with 12 additions and 0 deletions
|
|
@ -100,3 +100,15 @@ func (fbr FormatsByResolution) Less(i, j int) bool {
|
||||||
|
|
||||||
return iResX+iResY < jResX+jResY
|
return iResX+iResY < jResX+jResY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SubtitlesByLocale []*crunchyroll.Subtitle
|
||||||
|
|
||||||
|
func (sbl SubtitlesByLocale) Len() int {
|
||||||
|
return len(sbl)
|
||||||
|
}
|
||||||
|
func (sbl SubtitlesByLocale) Swap(i, j int) {
|
||||||
|
sbl[i], sbl[j] = sbl[j], sbl[i]
|
||||||
|
}
|
||||||
|
func (sbl SubtitlesByLocale) Less(i, j int) bool {
|
||||||
|
return sbl[i].Locale < sbl[j].Locale
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue