summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-12-26 17:40:50 +0000
committersr55 <[email protected]>2016-12-26 17:40:50 +0000
commit5b8ac227c6ae46a7f58319ca9c0aa73f775e4ee1 (patch)
tree72d7c4188e935c33254f8b0a466e8d9a3dcc6c03
parentd1376abc6678ab2b53b9b682493523263525b108 (diff)
WinGui: Fix "(Any)" language track option on the Audio Tab for Automatic Selection Behaviours
-rw-r--r--win/CS/HandBrakeWPF/Constants.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs11
2 files changed, 9 insertions, 7 deletions
diff --git a/win/CS/HandBrakeWPF/Constants.cs b/win/CS/HandBrakeWPF/Constants.cs
index c47bc8dc1..49e0183c5 100644
--- a/win/CS/HandBrakeWPF/Constants.cs
+++ b/win/CS/HandBrakeWPF/Constants.cs
@@ -40,6 +40,11 @@ namespace HandBrakeWPF
public const string Any = "(Any)";
/// <summary>
+ /// Undefined Language
+ /// </summary>
+ public const string Undefined = "und";
+
+ /// <summary>
/// The chapters.
/// </summary>
public const string Chapters = "{chapters}";
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index 9f3cd760d..1381fcca0 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -418,7 +418,7 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private void AddFirstForSelectedLanguages()
{
- foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks(false))
+ foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks())
{
// Step 2: Check if the track list already contrains this track
bool found = this.Task.AudioTracks.Any(audioTrack => Equals(audioTrack.ScannedTrack, sourceTrack));
@@ -448,7 +448,7 @@ namespace HandBrakeWPF.ViewModels
public void AddAllRemainingForSelectedLanguages()
{
// Add them if they are not already added.
- foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks(false))
+ foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks())
{
// Step 2: Check if the track list already contrains this track
bool found = this.Task.AudioTracks.Any(audioTrack => Equals(audioTrack.ScannedTrack, sourceTrack));
@@ -486,19 +486,16 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Gets a list of source tracks for the users selected languages.
/// </summary>
- /// <param name="includeAny">
- /// The include Any.
- /// </param>
/// <returns>
/// A list of source audio tracks.
/// </returns>
- private IEnumerable<Audio> GetSelectedLanguagesTracks(bool includeAny)
+ private IEnumerable<Audio> GetSelectedLanguagesTracks()
{
List<Audio> trackList = new List<Audio>();
List<string> isoCodes = LanguageUtilities.GetLanguageCodes(this.AudioBehaviours.SelectedLangauges.ToArray());
- if (includeAny)
+ if (isoCodes.Contains(Constants.Undefined))
{
isoCodes = LanguageUtilities.GetIsoCodes();
}