diff --git a/DownKyi.Core/FileName/FileName.cs b/DownKyi.Core/FileName/FileName.cs index 832a18d..2e8684d 100644 --- a/DownKyi.Core/FileName/FileName.cs +++ b/DownKyi.Core/FileName/FileName.cs @@ -15,6 +15,8 @@ namespace DownKyi.Core.FileName private string videoQuality = "VIDEO_QUALITY"; private string videoCodec = "VIDEO_CODEC"; + private string videoPublishTime = "VIDEO_PUBLISH_TIME"; + private long avid = -1; private string bvid = "BVID"; private long cid = -1; @@ -80,6 +82,12 @@ namespace DownKyi.Core.FileName return this; } + public FileName SetVideoPublishTime(string videoPublishTime) + { + this.videoPublishTime = videoPublishTime; + return this; + } + public FileName SetAvid(long avid) { this.avid = avid; @@ -149,6 +157,9 @@ namespace DownKyi.Core.FileName case FileNamePart.VIDEO_CODEC: path += videoCodec; break; + case FileNamePart.VIDEO_PUBLISH_TIME: + path += videoPublishTime; + break; case FileNamePart.AVID: path += avid; break; diff --git a/DownKyi.Core/FileName/FileNamePart.cs b/DownKyi.Core/FileName/FileNamePart.cs index c9fcd4e..059e408 100644 --- a/DownKyi.Core/FileName/FileNamePart.cs +++ b/DownKyi.Core/FileName/FileNamePart.cs @@ -12,6 +12,8 @@ VIDEO_QUALITY, VIDEO_CODEC, + VIDEO_PUBLISH_TIME, + AVID, BVID, CID, diff --git a/DownKyi/Languages/Default.xaml b/DownKyi/Languages/Default.xaml index 7842bf0..a590212 100644 --- a/DownKyi/Languages/Default.xaml +++ b/DownKyi/Languages/Default.xaml @@ -214,6 +214,7 @@ 音质 画质 视频编码 + 视频发布时间 空格 UP主ID UP主昵称 diff --git a/DownKyi/Services/BangumiInfoService.cs b/DownKyi/Services/BangumiInfoService.cs index 7e7d8b7..a11443f 100644 --- a/DownKyi/Services/BangumiInfoService.cs +++ b/DownKyi/Services/BangumiInfoService.cs @@ -120,6 +120,11 @@ namespace DownKyi.Services }; } + // 视频发布时间 + DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); // 当地时区 + DateTime dateTime = startTime.AddSeconds(episode.PubTime); + page.PublishTime = dateTime.ToString("yyyy-MM-dd"); + pages.Add(page); } diff --git a/DownKyi/Services/CheeseInfoService.cs b/DownKyi/Services/CheeseInfoService.cs index b6bd13a..a49e925 100644 --- a/DownKyi/Services/CheeseInfoService.cs +++ b/DownKyi/Services/CheeseInfoService.cs @@ -88,6 +88,11 @@ namespace DownKyi.Services }; } + // 视频发布时间 + DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); // 当地时区 + DateTime dateTime = startTime.AddSeconds(episode.ReleaseDate); + page.PublishTime = dateTime.ToString("yyyy-MM-dd"); + pages.Add(page); } diff --git a/DownKyi/Services/Download/AddToDownloadService.cs b/DownKyi/Services/Download/AddToDownloadService.cs index d83d589..f4b4ad3 100644 --- a/DownKyi/Services/Download/AddToDownloadService.cs +++ b/DownKyi/Services/Download/AddToDownloadService.cs @@ -295,6 +295,7 @@ namespace DownKyi.Services.Download .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" : "") + .SetVideoPublishTime(page.PublishTime) .SetAvid(page.Avid) .SetBvid(page.Bvid) .SetCid(page.Cid) diff --git a/DownKyi/Services/VideoInfoService.cs b/DownKyi/Services/VideoInfoService.cs index e091048..bd927a3 100644 --- a/DownKyi/Services/VideoInfoService.cs +++ b/DownKyi/Services/VideoInfoService.cs @@ -96,6 +96,11 @@ namespace DownKyi.Services }; } + // 视频发布时间 + DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); // 当地时区 + DateTime dateTime = startTime.AddSeconds(videoView.Pubdate); + videoPage.PublishTime = dateTime.ToString("yyyy-MM-dd"); + videoPages.Add(videoPage); } diff --git a/DownKyi/ViewModels/PageViewModels/VideoPage.cs b/DownKyi/ViewModels/PageViewModels/VideoPage.cs index 6f5153d..2e2f802 100644 --- a/DownKyi/ViewModels/PageViewModels/VideoPage.cs +++ b/DownKyi/ViewModels/PageViewModels/VideoPage.cs @@ -18,6 +18,7 @@ namespace DownKyi.ViewModels.PageViewModels public long Cid { get; set; } public long EpisodeId { get; set; } public VideoOwner Owner { get; set; } + public string PublishTime { get; set; } public string FirstFrame { get; set; } diff --git a/DownKyi/ViewModels/Settings/ViewVideoViewModel.cs b/DownKyi/ViewModels/Settings/ViewVideoViewModel.cs index 39c6548..002d20f 100644 --- a/DownKyi/ViewModels/Settings/ViewVideoViewModel.cs +++ b/DownKyi/ViewModels/Settings/ViewVideoViewModel.cs @@ -469,6 +469,9 @@ namespace DownKyi.ViewModels.Settings case FileNamePart.VIDEO_CODEC: display = DictionaryResource.GetString("DisplayVideoCodec"); break; + case FileNamePart.VIDEO_PUBLISH_TIME: + display = DictionaryResource.GetString("DisplayVideoPublishTime"); + break; case FileNamePart.AVID: display = "avid"; break;