Skip to content

Commit

Permalink
修改音质描述【普通音质有3档质量,但不是固定的320K或192K,因此仅用高中低表述,以免产生误解】
Browse files Browse the repository at this point in the history
  • Loading branch information
leiurayer committed Feb 27, 2023
1 parent 8cd0f82 commit becb4e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/DownKyi.Core/BiliApi/BiliUtils/Constant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ public static class Constant

private static readonly List<Quality> qualities = new List<Quality>
{
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 },
};
Expand Down
16 changes: 13 additions & 3 deletions src/DownKyi/Services/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ internal static void VideoPageInfo(PlayUrl playUrl, VideoPage page)
private static ObservableCollection<string> GetAudioQualityFormatList(PlayUrl playUrl, int defaultAudioQuality)
{
List<string> audioQualityFormatList = new List<string>();
List<string> sortList = new List<string>();
List<Quality> audioQualities = Constant.GetAudioQualities();

if (playUrl.Dash.Audio != null && playUrl.Dash.Audio.Count > 0)
Expand Down Expand Up @@ -131,10 +132,19 @@ private static ObservableCollection<string> GetAudioQualityFormatList(PlayUrl pl
}
}

audioQualityFormatList.Sort(new StringLogicalComparer<string>());
audioQualityFormatList.Reverse();
//audioQualityFormatList.Sort(new StringLogicalComparer<string>());
//audioQualityFormatList.Reverse();

return new ObservableCollection<string>(audioQualityFormatList);
foreach (var item in audioQualities)
{
if (audioQualityFormatList.Contains(item.Name))
{
sortList.Add(item.Name);
}
}
sortList.Reverse();

return new ObservableCollection<string>(sortList);
}

/// <summary>
Expand Down

0 comments on commit becb4e3

Please sign in to comment.