diff --git a/DatabaseManager/DatabaseManager.csproj b/DatabaseManager/DatabaseManager.csproj index 343a04e..cf3f451 100644 --- a/DatabaseManager/DatabaseManager.csproj +++ b/DatabaseManager/DatabaseManager.csproj @@ -127,7 +127,7 @@ - + 1.0.112.2 diff --git a/DownKyi.Core.Test/DownKyi.Core.Test.csproj b/DownKyi.Core.Test/DownKyi.Core.Test.csproj index 9a7c6c4..fcaf273 100644 --- a/DownKyi.Core.Test/DownKyi.Core.Test.csproj +++ b/DownKyi.Core.Test/DownKyi.Core.Test.csproj @@ -1,6 +1,6 @@  - + Debug @@ -56,10 +56,10 @@ - ..\packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + ..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll - ..\packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + ..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll @@ -104,10 +104,10 @@ 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 - - + + - + \ No newline at end of file diff --git a/DownKyi.Core.Test/app.config b/DownKyi.Core.Test/app.config index ef24f15..396ef7d 100644 --- a/DownKyi.Core.Test/app.config +++ b/DownKyi.Core.Test/app.config @@ -9,6 +9,10 @@ + + + + \ No newline at end of file diff --git a/DownKyi.Core.Test/packages.config b/DownKyi.Core.Test/packages.config index 82bdd21..b73e1b4 100644 --- a/DownKyi.Core.Test/packages.config +++ b/DownKyi.Core.Test/packages.config @@ -1,7 +1,7 @@  - - + + \ No newline at end of file diff --git a/DownKyi.Core/BiliApi/BiliUtils/Constant.cs b/DownKyi.Core/BiliApi/BiliUtils/Constant.cs index c8a3fa2..72afb80 100644 --- a/DownKyi.Core/BiliApi/BiliUtils/Constant.cs +++ b/DownKyi.Core/BiliApi/BiliUtils/Constant.cs @@ -6,17 +6,17 @@ namespace DownKyi.Core.BiliApi.BiliUtils { private static readonly List resolutions = new List { - new Quality { Name = "超高清 8K", Id = 127 }, - new Quality { Name = "杜比视界", Id = 126 }, - new Quality { Name = "HDR 真彩", Id = 125 }, - new Quality { Name = "4K 超清", Id = 120 }, - new Quality { Name = "1080P 60帧", Id = 116 }, - new Quality { Name = "1080P 高码率", Id = 112 }, - new Quality { Name = "1080P 高清", Id = 80 }, - new Quality { Name = "720P 60帧", Id = 74 }, - new Quality { Name = "720P 高清", Id = 64 }, - new Quality { Name = "480P 清晰", Id = 32 }, new Quality { Name = "360P 流畅", Id = 16 }, + new Quality { Name = "480P 清晰", Id = 32 }, + new Quality { Name = "720P 高清", Id = 64 }, + new Quality { Name = "720P 60帧", Id = 74 }, + new Quality { Name = "1080P 高清", Id = 80 }, + new Quality { Name = "1080P 高码率", Id = 112 }, + new Quality { Name = "1080P 60帧", Id = 116 }, + new Quality { Name = "4K 超清", Id = 120 }, + new Quality { Name = "HDR 真彩", Id = 125 }, + new Quality { Name = "杜比视界", Id = 126 }, + new Quality { Name = "超高清 8K", Id = 127 }, }; private static readonly List codecIds = new List diff --git a/DownKyi.Core/DownKyi.Core.csproj b/DownKyi.Core/DownKyi.Core.csproj index 0c61a49..e59b8bf 100644 --- a/DownKyi.Core/DownKyi.Core.csproj +++ b/DownKyi.Core/DownKyi.Core.csproj @@ -52,8 +52,8 @@ ..\packages\Brotli.NET.2.1.1\lib\net45\Brotli.Core.dll - - ..\packages\Google.Protobuf.3.20.1\lib\net45\Google.Protobuf.dll + + ..\packages\Google.Protobuf.3.21.8\lib\net45\Google.Protobuf.dll ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll @@ -73,8 +73,8 @@ - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll @@ -388,9 +388,9 @@ - + - + \ No newline at end of file diff --git a/DownKyi.Core/app.config b/DownKyi.Core/app.config index 1696df6..a1e2bff 100644 --- a/DownKyi.Core/app.config +++ b/DownKyi.Core/app.config @@ -6,6 +6,10 @@ + + + + \ No newline at end of file diff --git a/DownKyi.Core/packages.config b/DownKyi.Core/packages.config index cb9cf13..c48d9de 100644 --- a/DownKyi.Core/packages.config +++ b/DownKyi.Core/packages.config @@ -1,13 +1,13 @@  - - + + - + diff --git a/DownKyi/Services/Download/AddToDownloadService.cs b/DownKyi/Services/Download/AddToDownloadService.cs index c90519d..eddb62a 100644 --- a/DownKyi/Services/Download/AddToDownloadService.cs +++ b/DownKyi/Services/Download/AddToDownloadService.cs @@ -260,7 +260,7 @@ namespace DownKyi.Services.Download } if (isDownloading) { continue; } - // 如果存在下载完成列表,弹出选择框是否再次下载 + // TODO 如果存在下载完成列表,弹出选择框是否再次下载 bool isDownloaded = false; foreach (DownloadedItem item in App.DownloadedList) { @@ -304,14 +304,14 @@ namespace DownKyi.Services.Download // 文件路径 List fileNameParts = SettingsManager.GetInstance().GetFileNameParts(); - FileName fileName = FileName.Builder(fileNameParts) + FileName fileName = FileName.Builder(fileNameParts) .SetSection(Format.FormatFileName(sectionName)) .SetMainTitle(Format.FormatFileName(videoInfoView.Title)) .SetPageTitle(Format.FormatFileName(page.Name)) .SetVideoZone(videoInfoView.VideoZone.Split('>')[0]) .SetAudioQuality(page.AudioQualityFormat) .SetVideoQuality(page.VideoQuality == null ? "" : page.VideoQuality.QualityFormat) - .SetVideoCodec(page.VideoQuality == null ? "" : page.VideoQuality.SelectedVideoCodec.Contains("AVC") ? "AVC" : page.VideoQuality.SelectedVideoCodec.Contains("HEVC") ? "HEVC" : page.VideoQuality.SelectedVideoCodec.Contains("Dolby") ? "Dolby Vision" : "") + .SetVideoCodec(page.VideoQuality == null ? "" : page.VideoQuality.SelectedVideoCodec.Contains("AVC") ? "AVC" : page.VideoQuality.SelectedVideoCodec.Contains("HEVC") ? "HEVC" : page.VideoQuality.SelectedVideoCodec.Contains("Dolby") ? "Dolby Vision" : page.VideoQuality.SelectedVideoCodec.Contains("AV1") ? "AV1" : "") .SetVideoPublishTime(page.PublishTime) .SetAvid(page.Avid) .SetBvid(page.Bvid) diff --git a/DownKyi/Services/Utils.cs b/DownKyi/Services/Utils.cs index b3e055a..732f305 100644 --- a/DownKyi/Services/Utils.cs +++ b/DownKyi/Services/Utils.cs @@ -89,40 +89,6 @@ namespace DownKyi.Services } } - /// - /// 设置音质 - /// - /// - /// - /// - private static ObservableCollection GetAudioQualityFormatList_old(PlayUrl playUrl, int defaultAudioQuality) - { - List audioQualityFormatList = new List(); - - if (playUrl.Dash.Audio == null) - { - return new ObservableCollection(); - } - - foreach (PlayUrlDashVideo audio in playUrl.Dash.Audio) - { - // 音质id大于设置画质时,跳过 - if (audio.Id > defaultAudioQuality) { continue; } - - Quality audioQuality = Constant.GetAudioQualities().FirstOrDefault(t => { return t.Id == audio.Id; }); - if (audioQuality != null) - { - ListHelper.AddUnique(audioQualityFormatList, audioQuality.Name); - } - } - - audioQualityFormatList.Sort(new StringLogicalComparer()); - audioQualityFormatList.Reverse(); - - return new ObservableCollection(audioQualityFormatList); - } - - /// /// 设置音质 /// @@ -244,52 +210,33 @@ namespace DownKyi.Services VideoQuality selectedVideoQuality = videoQualityList.FirstOrDefault(t => t.Quality == video.Id); if (selectedVideoQuality == null) { continue; } - if (videoQualityList[videoQualityList.IndexOf(selectedVideoQuality)].VideoCodecList.Count == 1) - { - // 当获取的视频没有设置的视频编码时,执行 - videoQualityList[videoQualityList.IndexOf(selectedVideoQuality)].SelectedVideoCodec = videoQualityList[videoQualityList.IndexOf(selectedVideoQuality)].VideoCodecList[0]; - } - // 设置选中的视频编码 - //switch (videoCodecs) - //{ - // case VideoCodecs.AVC: - // if (videoQualityList[videoQualityList.IndexOf(selectedVideoQuality)].VideoCodecList.Contains("H.264/AVC")) - // { - // videoQualityList[videoQualityList.IndexOf(selectedVideoQuality)].SelectedVideoCodec = "H.264/AVC"; - // } - // break; - // case VideoCodecs.HEVC: - // if (videoQualityList[videoQualityList.IndexOf(selectedVideoQuality)].VideoCodecList.Contains("H.265/HEVC")) - // { - // videoQualityList[videoQualityList.IndexOf(selectedVideoQuality)].SelectedVideoCodec = "H.265/HEVC"; - // } - // break; - // case VideoCodecs.NONE: - // break; - // default: - // break; - //} string videoCodecsName = codeIds.FirstOrDefault(t => t.Id == videoCodecs).Name; if (videoQualityList[videoQualityList.IndexOf(selectedVideoQuality)].VideoCodecList.Contains(videoCodecsName)) { videoQualityList[videoQualityList.IndexOf(selectedVideoQuality)].SelectedVideoCodec = videoCodecsName; } + else + { + // 当获取的视频没有设置的视频编码时 + foreach (Quality codec in codeIds) + { + if (videoQualityList[videoQualityList.IndexOf(selectedVideoQuality)].VideoCodecList.Contains(codec.Name)) + { + videoQualityList[videoQualityList.IndexOf(selectedVideoQuality)].SelectedVideoCodec = codec.Name; + } + + if (codec.Id == videoCodecs) + { + break; + } + } + } } return videoQualityList; } - /// - /// 根据输入的字符串判断是AVC还是HEVC - /// - /// - /// - //internal static string GetVideoCodecName(string origin) - //{ - // return origin.Contains("avc") ? "H.264/AVC" : origin.Contains("hev") ? "H.265/HEVC" : origin.Contains("dvh") || origin.Contains("hvc") ? "Dolby Vision" : ""; - //} - } } diff --git a/DownKyi/Views/Settings/ViewAbout.xaml b/DownKyi/Views/Settings/ViewAbout.xaml index 6912849..49ab9a5 100644 --- a/DownKyi/Views/Settings/ViewAbout.xaml +++ b/DownKyi/Views/Settings/ViewAbout.xaml @@ -188,7 +188,7 @@ Grid.Column="2" FontSize="12" Foreground="{DynamicResource BrushTextDark}" - Text="3.20.1" /> + Text="3.21.8" />