文件命名格式新增视频发布时间

croire 3 years ago
parent 0257df9fbe
commit c1ea829215

@ -15,6 +15,8 @@ namespace DownKyi.Core.FileName
private string videoQuality = "VIDEO_QUALITY"; private string videoQuality = "VIDEO_QUALITY";
private string videoCodec = "VIDEO_CODEC"; private string videoCodec = "VIDEO_CODEC";
private string videoPublishTime = "VIDEO_PUBLISH_TIME";
private long avid = -1; private long avid = -1;
private string bvid = "BVID"; private string bvid = "BVID";
private long cid = -1; private long cid = -1;
@ -80,6 +82,12 @@ namespace DownKyi.Core.FileName
return this; return this;
} }
public FileName SetVideoPublishTime(string videoPublishTime)
{
this.videoPublishTime = videoPublishTime;
return this;
}
public FileName SetAvid(long avid) public FileName SetAvid(long avid)
{ {
this.avid = avid; this.avid = avid;
@ -149,6 +157,9 @@ namespace DownKyi.Core.FileName
case FileNamePart.VIDEO_CODEC: case FileNamePart.VIDEO_CODEC:
path += videoCodec; path += videoCodec;
break; break;
case FileNamePart.VIDEO_PUBLISH_TIME:
path += videoPublishTime;
break;
case FileNamePart.AVID: case FileNamePart.AVID:
path += avid; path += avid;
break; break;

@ -12,6 +12,8 @@
VIDEO_QUALITY, VIDEO_QUALITY,
VIDEO_CODEC, VIDEO_CODEC,
VIDEO_PUBLISH_TIME,
AVID, AVID,
BVID, BVID,
CID, CID,

@ -214,6 +214,7 @@
<system:String x:Key="DisplayAudioQuality">音质</system:String> <system:String x:Key="DisplayAudioQuality">音质</system:String>
<system:String x:Key="DisplayVideoQuality">画质</system:String> <system:String x:Key="DisplayVideoQuality">画质</system:String>
<system:String x:Key="DisplayVideoCodec">视频编码</system:String> <system:String x:Key="DisplayVideoCodec">视频编码</system:String>
<system:String x:Key="DisplayVideoPublishTime">视频发布时间</system:String>
<system:String x:Key="DisplaySpace">空格</system:String> <system:String x:Key="DisplaySpace">空格</system:String>
<system:String x:Key="DisplayUpMid">UP主ID</system:String> <system:String x:Key="DisplayUpMid">UP主ID</system:String>
<system:String x:Key="DisplayUpName">UP主昵称</system:String> <system:String x:Key="DisplayUpName">UP主昵称</system:String>

@ -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); pages.Add(page);
} }

@ -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); pages.Add(page);
} }

@ -295,6 +295,7 @@ namespace DownKyi.Services.Download
.SetAudioQuality(page.AudioQualityFormat) .SetAudioQuality(page.AudioQualityFormat)
.SetVideoQuality(page.VideoQuality == null ? "" : page.VideoQuality.QualityFormat) .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" : "")
.SetVideoPublishTime(page.PublishTime)
.SetAvid(page.Avid) .SetAvid(page.Avid)
.SetBvid(page.Bvid) .SetBvid(page.Bvid)
.SetCid(page.Cid) .SetCid(page.Cid)

@ -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); videoPages.Add(videoPage);
} }

@ -18,6 +18,7 @@ namespace DownKyi.ViewModels.PageViewModels
public long Cid { get; set; } public long Cid { get; set; }
public long EpisodeId { get; set; } public long EpisodeId { get; set; }
public VideoOwner Owner { get; set; } public VideoOwner Owner { get; set; }
public string PublishTime { get; set; }
public string FirstFrame { get; set; } public string FirstFrame { get; set; }

@ -469,6 +469,9 @@ namespace DownKyi.ViewModels.Settings
case FileNamePart.VIDEO_CODEC: case FileNamePart.VIDEO_CODEC:
display = DictionaryResource.GetString("DisplayVideoCodec"); display = DictionaryResource.GetString("DisplayVideoCodec");
break; break;
case FileNamePart.VIDEO_PUBLISH_TIME:
display = DictionaryResource.GetString("DisplayVideoPublishTime");
break;
case FileNamePart.AVID: case FileNamePart.AVID:
display = "avid"; display = "avid";
break; break;

Loading…
Cancel
Save