From 5e1b2fcf6f1238efc15057ee44e42643dc9b5793 Mon Sep 17 00:00:00 2001 From: Strangelovian Date: Sun, 2 Jul 2017 23:22:01 +0200 Subject: instead of language name, use language code for prefered audio and prefered subtitle selection --- win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs | 5 +++-- win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'win/CS/HandBrakeWPF') diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs index 771267e26..83f509269 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs @@ -495,9 +495,10 @@ namespace HandBrakeWPF.ViewModels if (this.AudioBehaviours.SelectedLangauges.Count > 0) { string langName = this.AudioBehaviours.SelectedLangauges.FirstOrDefault(w => !w.Equals(Constants.Any)); - if (!string.IsNullOrEmpty(langName)) + string langCode = LanguageUtilities.GetLanguageCode(langName); + if (!string.IsNullOrEmpty(langCode)) { - preferredAudioTracks = this.SourceTracks.Where(item => item.Language.Contains(langName)); + preferredAudioTracks = this.SourceTracks.Where(item => item.LanguageCode.Contains(langCode)); } } diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index f1191edae..d747c6112 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -602,7 +602,9 @@ namespace HandBrakeWPF.ViewModels /// private string GetPreferredSubtitleTrackLanguage() { - return this.SubtitleBehaviours.SelectedLangauges.FirstOrDefault(w => w != Constants.Any); + string langName = this.SubtitleBehaviours.SelectedLangauges.FirstOrDefault(w => w != Constants.Any); + string langCode = LanguageUtilities.GetLanguageCode(langName); + return langCode; } /// -- cgit v1.2.3