From 35e6d2e8c87c33464f713fa716d6e42280a137a1 Mon Sep 17 00:00:00 2001 From: croire <1432593898@qq.com> Date: Sat, 5 Mar 2022 16:16:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8D=95=E8=8E=B7Constant.GetAudioQualities()?= =?UTF-8?q?=E4=B8=ADitem=E6=95=B0=E9=87=8F=E5=BC=82=E5=B8=B8=EF=BC=8C?= =?UTF-8?q?=E6=9A=82=E6=97=B6=E6=9C=AA=E7=9F=A5=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DownKyi/ViewModels/PageViewModels/VideoPage.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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