From 1ba868d613a7584636749e0ecce530b38cbb9889 Mon Sep 17 00:00:00 2001 From: croire <1432593898@qq.com> Date: Sat, 5 Mar 2022 16:13:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=91=BD=E5=90=8D=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E6=96=B0=E5=A2=9Eavid=E3=80=81bvid=E3=80=81cid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DownKyi.Core/FileName/FileName.cs | 31 +++++++++++++++++++ DownKyi.Core/FileName/FileNamePart.cs | 4 +++ .../Services/Download/AddToDownloadService.cs | 5 ++- .../ViewModels/Settings/ViewVideoViewModel.cs | 9 ++++++ 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/DownKyi.Core/FileName/FileName.cs b/DownKyi.Core/FileName/FileName.cs index 23d9c1d..4d7d97d 100644 --- a/DownKyi.Core/FileName/FileName.cs +++ b/DownKyi.Core/FileName/FileName.cs @@ -15,6 +15,10 @@ namespace DownKyi.Core.FileName private string videoQuality = "VIDEO_QUALITY"; private string videoCodec = "VIDEO_CODEC"; + private long avid = -1; + private string bvid = "BVID"; + private long cid = -1; + private FileName(List nameParts) { this.nameParts = nameParts; @@ -73,6 +77,24 @@ namespace DownKyi.Core.FileName return this; } + public FileName SetAvid(long avid) + { + this.avid = avid; + return this; + } + + public FileName SetBvid(string bvid) + { + this.bvid = bvid; + return this; + } + + public FileName SetCid(long cid) + { + this.cid = cid; + return this; + } + public string RelativePath() { string path = string.Empty; @@ -112,6 +134,15 @@ namespace DownKyi.Core.FileName case FileNamePart.VIDEO_CODEC: path += videoCodec; break; + case FileNamePart.AVID: + path += avid; + break; + case FileNamePart.BVID: + path += bvid; + break; + case FileNamePart.CID: + path += cid; + break; } if (((int)part) >= 100) diff --git a/DownKyi.Core/FileName/FileNamePart.cs b/DownKyi.Core/FileName/FileNamePart.cs index 551829c..ca9e6a4 100644 --- a/DownKyi.Core/FileName/FileNamePart.cs +++ b/DownKyi.Core/FileName/FileNamePart.cs @@ -12,6 +12,10 @@ VIDEO_QUALITY, VIDEO_CODEC, + AVID, + BVID, + CID, + // 斜杠 SLASH = 100, diff --git a/DownKyi/Services/Download/AddToDownloadService.cs b/DownKyi/Services/Download/AddToDownloadService.cs index 939dcf6..b827aa0 100644 --- a/DownKyi/Services/Download/AddToDownloadService.cs +++ b/DownKyi/Services/Download/AddToDownloadService.cs @@ -294,7 +294,10 @@ namespace DownKyi.Services.Download .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" : "") + .SetAvid(page.Avid) + .SetBvid(page.Bvid) + .SetCid(page.Cid); string filePath = Path.Combine(directory, fileName.RelativePath()); // 视频类别 diff --git a/DownKyi/ViewModels/Settings/ViewVideoViewModel.cs b/DownKyi/ViewModels/Settings/ViewVideoViewModel.cs index a36ac6d..e401f02 100644 --- a/DownKyi/ViewModels/Settings/ViewVideoViewModel.cs +++ b/DownKyi/ViewModels/Settings/ViewVideoViewModel.cs @@ -469,6 +469,15 @@ namespace DownKyi.ViewModels.Settings case FileNamePart.VIDEO_CODEC: display = DictionaryResource.GetString("DisplayVideoCodec"); break; + case FileNamePart.AVID: + display = "avid"; + break; + case FileNamePart.BVID: + display = "bvid"; + break; + case FileNamePart.CID: + display = "cid"; + break; } if (((int)item) >= 100)