fix bug:Issues 下载管理在只下载音频的情况下点击打开文件夹没反应 #709

pull/708/head
初十 2 years ago
parent e40581107b
commit 0d0f2e8cfe

@ -91,18 +91,24 @@ namespace DownKyi.ViewModels.DownloadManager
private void ExecuteOpenFolderCommand() private void ExecuteOpenFolderCommand()
{ {
if (DownloadBase == null) { return; } if (DownloadBase == null) { return; }
//TODO:这里不光有mp4视频文件也可能存在音频文件.aac这里需要将所有文件的后缀名枚举出来
string videoPath = $"{DownloadBase.FilePath}.mp4"; //fix bug:Issues #709
string[] fileType = new string[] {".mp4",".aac" };
foreach (string type in fileType)
{
string videoPath = $"{DownloadBase.FilePath}{type}";
FileInfo fileInfo = new FileInfo(videoPath); FileInfo fileInfo = new FileInfo(videoPath);
if (File.Exists(fileInfo.FullName)) if (File.Exists(fileInfo.FullName))
{ {
System.Diagnostics.Process.Start("Explorer", "/select," + fileInfo.FullName); System.Diagnostics.Process.Start("Explorer", "/select," + fileInfo.FullName);
break;
} }
else else
{ {
//eventAggregator.GetEvent<MessageEvent>().Publish("没有找到视频文件,可能被删除或移动!"); //eventAggregator.GetEvent<MessageEvent>().Publish("没有找到视频文件,可能被删除或移动!");
} }
} }
}
// 打开视频事件 // 打开视频事件
private DelegateCommand openVideoCommand; private DelegateCommand openVideoCommand;

Loading…
Cancel
Save