diff options
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs | 12 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs | 10 |
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>
|