From a9e2e3aeeb366533af5ea510a1614826651a6128 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 4 May 2019 20:06:57 +0100 Subject: [PATCH] WinGui: Allow SSA files to be dropped on the UI. --- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 6e9956645..d39975244 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1716,7 +1716,7 @@ namespace HandBrakeWPF.ViewModels string[] fileNames = e.Data.GetData(DataFormats.FileDrop, true) as string[]; if (fileNames != null && fileNames.Any() && (File.Exists(fileNames[0]) || Directory.Exists(fileNames[0]))) { - string videoContent = fileNames.FirstOrDefault(f => Path.GetExtension(f)?.ToLower() != ".srt"); + string videoContent = fileNames.FirstOrDefault(f => Path.GetExtension(f)?.ToLower() != ".srt" && Path.GetExtension(f)?.ToLower() != ".ssa"); if (!string.IsNullOrEmpty(videoContent)) { this.StartScan(videoContent, 0); @@ -1730,10 +1730,11 @@ namespace HandBrakeWPF.ViewModels Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + return; } // StartScan is not synchronous, so for now we don't support adding both srt and video file at the same time. - string[] subtitleFiles = fileNames.Where(f => Path.GetExtension(f)?.ToLower() == ".srt").ToArray(); + string[] subtitleFiles = fileNames.Where(f => Path.GetExtension(f)?.ToLower() == ".srt" || Path.GetExtension(f)?.ToLower() == ".ssa").ToArray(); if (subtitleFiles.Any()) { this.SwitchTab(5); -- 2.40.0