From cd4e16022d929e3d59e73d651274f9f7f1b048ca Mon Sep 17 00:00:00 2001 From: croire <1432593898@qq.com> Date: Fri, 17 Feb 2023 23:45:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9F=B3=E8=B4=A8=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E3=80=90=E6=99=AE=E9=80=9A=E9=9F=B3=E8=B4=A8=E6=9C=89?= =?UTF-8?q?3=E6=A1=A3=E8=B4=A8=E9=87=8F=EF=BC=8C=E4=BD=86=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E5=9B=BA=E5=AE=9A=E7=9A=84320K=E6=88=96192K=EF=BC=8C?= =?UTF-8?q?=E5=9B=A0=E6=AD=A4=E4=BB=85=E7=94=A8=E9=AB=98=E4=B8=AD=E4=BD=8E?= =?UTF-8?q?=E8=A1=A8=E8=BF=B0=EF=BC=8C=E4=BB=A5=E5=85=8D=E4=BA=A7=E7=94=9F?= =?UTF-8?q?=E8=AF=AF=E8=A7=A3=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DownKyi.Core/BiliApi/BiliUtils/Constant.cs | 9 ++++++--- DownKyi/Services/Utils.cs | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/DownKyi.Core/BiliApi/BiliUtils/Constant.cs b/DownKyi.Core/BiliApi/BiliUtils/Constant.cs index 72afb80..e0df068 100644 --- a/DownKyi.Core/BiliApi/BiliUtils/Constant.cs +++ b/DownKyi.Core/BiliApi/BiliUtils/Constant.cs @@ -28,9 +28,12 @@ namespace DownKyi.Core.BiliApi.BiliUtils private static readonly List qualities = new List { - new Quality { Name = "64K", Id = 30216 }, - new Quality { Name = "132K", Id = 30232 }, - new Quality { Name = "192K", Id = 30280 }, + //new Quality { Name = "64K", Id = 30216 }, + //new Quality { Name = "132K", Id = 30232 }, + //new Quality { Name = "192K", Id = 30280 }, + new Quality { Name = "低质量", Id = 30216 }, + new Quality { Name = "中质量", Id = 30232 }, + new Quality { Name = "高质量", Id = 30280 }, new Quality { Name = "Dolby Atmos", Id = 30250 }, new Quality { Name = "Hi-Res无损", Id = 30251 }, }; diff --git a/DownKyi/Services/Utils.cs b/DownKyi/Services/Utils.cs index 988ffc2..6abbd94 100644 --- a/DownKyi/Services/Utils.cs +++ b/DownKyi/Services/Utils.cs @@ -98,6 +98,7 @@ namespace DownKyi.Services private static ObservableCollection GetAudioQualityFormatList(PlayUrl playUrl, int defaultAudioQuality) { List audioQualityFormatList = new List(); + List sortList = new List(); List audioQualities = Constant.GetAudioQualities(); if (playUrl.Dash.Audio != null && playUrl.Dash.Audio.Count > 0) @@ -131,10 +132,19 @@ namespace DownKyi.Services } } - audioQualityFormatList.Sort(new StringLogicalComparer()); - audioQualityFormatList.Reverse(); + //audioQualityFormatList.Sort(new StringLogicalComparer()); + //audioQualityFormatList.Reverse(); - return new ObservableCollection(audioQualityFormatList); + foreach (var item in audioQualities) + { + if (audioQualityFormatList.Contains(item.Name)) + { + sortList.Add(item.Name); + } + } + sortList.Reverse(); + + return new ObservableCollection(sortList); } ///