diff --git a/DownKyi/ViewModels/PageViewModels/VideoPage.cs b/DownKyi/ViewModels/PageViewModels/VideoPage.cs index be645a9..24b1fb0 100644 --- a/DownKyi/ViewModels/PageViewModels/VideoPage.cs +++ b/DownKyi/ViewModels/PageViewModels/VideoPage.cs @@ -1,8 +1,10 @@ using DownKyi.Core.BiliApi.BiliUtils; using DownKyi.Core.BiliApi.VideoStream.Models; +using DownKyi.Core.Logging; using DownKyi.Core.Utils; using Prism.Commands; using Prism.Mvvm; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -87,7 +89,18 @@ namespace DownKyi.ViewModels.PageViewModels private void ExecuteVideoQualitySelectedCommand() { // 杜比视界 - string dolby = Constant.GetAudioQualities()[3].Name; + string dolby = string.Empty; + try + { + var qualities = Constant.GetAudioQualities(); + dolby = qualities[3].Name; + } + catch (Exception e) + { + Core.Utils.Debugging.Console.PrintLine("ExecuteVideoQualitySelectedCommand()发生异常: {0}", e); + LogManager.Error("ExecuteVideoQualitySelectedCommand", e); + } + if (VideoQuality != null && VideoQuality.Quality == 126) { ListHelper.AddUnique(AudioQualityFormatList, dolby); @@ -101,7 +114,6 @@ namespace DownKyi.ViewModels.PageViewModels AudioQualityFormat = AudioQualityFormatList[0]; } } - } #endregion