summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2019-04-17 20:45:21 +0100
committersr55 <[email protected]>2019-04-17 20:45:21 +0100
commit270c8972c94f6dda9405fa24f316754feb784e0b (patch)
treeac2d24162376a30d0c797e448df3e54c51d03174 /win/CS/HandBrakeWPF/ViewModels
parent1f07f6747f74fa4e34104e3aaaa1604ac3c7fb68 (diff)
WinGui: Fix Language ordering for Audio and Subtitle tabs. Fixes #2050
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs12
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs10
2 files changed, 15 insertions, 7 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index 348bfd176..aacc4b7d2 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -530,7 +530,7 @@ namespace HandBrakeWPF.ViewModels
foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks())
{
- // Step 2: Check if the track list already contrains this track
+ // Step 2: Check if the track list already contains this track
bool found = this.Task.AudioTracks.Any(audioTrack => Equals(audioTrack.ScannedTrack, sourceTrack));
if (!found)
{
@@ -631,10 +631,14 @@ namespace HandBrakeWPF.ViewModels
? LanguageUtilities.GetIsoCodes()
: LanguageUtilities.GetLanguageCodes(this.AudioBehaviours.SelectedLangauges.ToArray());
- List<Audio> availableTracks =
- this.SourceTracks.Where(audio => iso6392Codes.Contains(audio.LanguageCode.Trim())).ToList();
- return availableTracks;
+ List<Audio> orderedTracks = new List<Audio>();
+ foreach (string code in iso6392Codes)
+ {
+ orderedTracks.AddRange(this.SourceTracks.Where(audio => audio.LanguageCode == code));
+ }
+
+ return orderedTracks;
}
#endregion
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
index b07200ca6..035da87ed 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
@@ -712,10 +712,14 @@ namespace HandBrakeWPF.ViewModels
: LanguageUtilities.GetLanguageCodes(
this.SubtitleBehaviours.SelectedLangauges.ToArray());
- List<Subtitle> availableTracks =
- this.SourceTracks.Where(subtitle => iso6392Codes.Contains(subtitle.LanguageCodeClean)).ToList();
- return availableTracks;
+ List<Subtitle> orderedSubtitles = new List<Subtitle>();
+ foreach (string code in iso6392Codes)
+ {
+ orderedSubtitles.AddRange(this.SourceTracks.Where(subtitle => subtitle.LanguageCodeClean == code ));
+ }
+
+ return orderedSubtitles;
}
/// <summary>