mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-12 12:05:07 +00:00
sort_subtitles applied the language sort before the type sort. Python sorts are stable, so the last pass wins and type became the major key: every forced track, then every normal, then every SDH, each block ordered by language. In a title with many languages this put a track far from its own SDH version, for example Finnish at track 5 and Finnish SDH at track 42. Add a group_by parameter that selects the major key. "type" is the default and keeps the current order byte for byte. "language" swaps the two passes so each language stays next to its own variants. Read it from the new subtitle.group_by config key. Also correct the docs: type_priority was described as sorting the variants within each language, which was never true. It ranks the types across all languages.