From 0d0f2e8cfe6cf280e21101066eb934e2d630a1bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=9D=E5=8D=81?= <392706283@qq.com> Date: Sat, 8 Apr 2023 10:17:05 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug:Issues=20=E4=B8=8B=E8=BD=BD=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=9C=A8=E5=8F=AA=E4=B8=8B=E8=BD=BD=E9=9F=B3=E9=A2=91?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E7=82=B9=E5=87=BB=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=96=87=E4=BB=B6=E5=A4=B9=E6=B2=A1=E5=8F=8D=E5=BA=94?= =?UTF-8?q?=20#709?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DownloadManager/DownloadedItem.cs | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/DownKyi/ViewModels/DownloadManager/DownloadedItem.cs b/src/DownKyi/ViewModels/DownloadManager/DownloadedItem.cs index 8bb6518..1582535 100644 --- a/src/DownKyi/ViewModels/DownloadManager/DownloadedItem.cs +++ b/src/DownKyi/ViewModels/DownloadManager/DownloadedItem.cs @@ -91,16 +91,22 @@ namespace DownKyi.ViewModels.DownloadManager private void ExecuteOpenFolderCommand() { if (DownloadBase == null) { return; } - - string videoPath = $"{DownloadBase.FilePath}.mp4"; - FileInfo fileInfo = new FileInfo(videoPath); - if (File.Exists(fileInfo.FullName)) + //TODO:这里不光有mp4视频文件,也可能存在音频文件.aac这里需要将所有文件的后缀名枚举出来 + //fix bug:Issues #709 + string[] fileType = new string[] {".mp4",".aac" }; + foreach (string type in fileType) { - System.Diagnostics.Process.Start("Explorer", "/select," + fileInfo.FullName); - } - else - { - //eventAggregator.GetEvent().Publish("没有找到视频文件,可能被删除或移动!"); + string videoPath = $"{DownloadBase.FilePath}{type}"; + FileInfo fileInfo = new FileInfo(videoPath); + if (File.Exists(fileInfo.FullName)) + { + System.Diagnostics.Process.Start("Explorer", "/select," + fileInfo.FullName); + break; + } + else + { + //eventAggregator.GetEvent().Publish("没有找到视频文件,可能被删除或移动!"); + } } }