summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-02-05 20:16:03 +0000
committersr55 <[email protected]>2020-02-05 20:16:03 +0000
commitd388fee8e2773792254373eef770c6948ebbc1d4 (patch)
tree20aa5d8ddbbe81c684665d0f53df4a8b2dd53bfd /win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
parentd212e7c22a0155bab4bc57839383872b919af9fa (diff)
WinGui: Improve the way the Audio and Subtitle Language selection is handled. When "(Any)" is used, make sure to honour the order of any languages that are also selected as a priority. Fixes #2611
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs16
1 files changed, 11 insertions, 5 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index 39a1a224a..cdf494c69 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -627,11 +627,17 @@ namespace HandBrakeWPF.ViewModels
private IEnumerable<Audio> GetSelectedLanguagesTracks()
{
// Translate to Iso Codes
- List<string> iso6392Codes = this.AudioBehaviours.SelectedLangauges.Contains(Constants.Any)
- ? LanguageUtilities.GetIsoCodes()
- : LanguageUtilities.GetLanguageCodes(this.AudioBehaviours.SelectedLangauges.ToArray());
-
-
+ List<string> iso6392Codes = new List<string>();
+ if (this.AudioBehaviours.SelectedLangauges.Contains(Constants.Any))
+ {
+ iso6392Codes = LanguageUtilities.GetIsoCodes();
+ iso6392Codes = LanguageUtilities.OrderIsoCodes(iso6392Codes, this.AudioBehaviours.SelectedLangauges);
+ }
+ else
+ {
+ iso6392Codes = LanguageUtilities.GetLanguageCodes(this.AudioBehaviours.SelectedLangauges.ToArray());
+ }
+
List<Audio> orderedTracks = new List<Audio>();
foreach (string code in iso6392Codes)
{