文件命名格式新增avid、bvid、cid

croire 3 years ago
parent 4773a2b0c8
commit 1ba868d613

@ -15,6 +15,10 @@ 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 long avid = -1;
private string bvid = "BVID";
private long cid = -1;
private FileName(List<FileNamePart> nameParts) private FileName(List<FileNamePart> nameParts)
{ {
this.nameParts = nameParts; this.nameParts = nameParts;
@ -73,6 +77,24 @@ namespace DownKyi.Core.FileName
return this; 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() public string RelativePath()
{ {
string path = string.Empty; string path = string.Empty;
@ -112,6 +134,15 @@ namespace DownKyi.Core.FileName
case FileNamePart.VIDEO_CODEC: case FileNamePart.VIDEO_CODEC:
path += videoCodec; path += videoCodec;
break; break;
case FileNamePart.AVID:
path += avid;
break;
case FileNamePart.BVID:
path += bvid;
break;
case FileNamePart.CID:
path += cid;
break;
} }
if (((int)part) >= 100) if (((int)part) >= 100)

@ -12,6 +12,10 @@
VIDEO_QUALITY, VIDEO_QUALITY,
VIDEO_CODEC, VIDEO_CODEC,
AVID,
BVID,
CID,
// 斜杠 // 斜杠
SLASH = 100, SLASH = 100,

@ -294,7 +294,10 @@ namespace DownKyi.Services.Download
.SetVideoZone(videoInfoView.VideoZone.Split('>')[0]) .SetVideoZone(videoInfoView.VideoZone.Split('>')[0])
.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" : "")
.SetAvid(page.Avid)
.SetBvid(page.Bvid)
.SetCid(page.Cid);
string filePath = Path.Combine(directory, fileName.RelativePath()); string filePath = Path.Combine(directory, fileName.RelativePath());
// 视频类别 // 视频类别

@ -469,6 +469,15 @@ namespace DownKyi.ViewModels.Settings
case FileNamePart.VIDEO_CODEC: case FileNamePart.VIDEO_CODEC:
display = DictionaryResource.GetString("DisplayVideoCodec"); display = DictionaryResource.GetString("DisplayVideoCodec");
break; break;
case FileNamePart.AVID:
display = "avid";
break;
case FileNamePart.BVID:
display = "bvid";
break;
case FileNamePart.CID:
display = "cid";
break;
} }
if (((int)item) >= 100) if (((int)item) >= 100)

Loading…
Cancel
Save