修复视频标题和分P标题相同时找不到下载文件的问题

croire 3 years ago
parent 8317865b41
commit 56db28c913

@ -302,7 +302,7 @@ namespace DownKyi.Services.Download
.SetBvid(page.Bvid) .SetBvid(page.Bvid)
.SetCid(page.Cid) .SetCid(page.Cid)
.SetUpMid(page.Owner.Mid) .SetUpMid(page.Owner.Mid)
.SetUpName(page.Owner.Name); .SetUpName(Format.FormatFileName(page.Owner.Name));
string filePath = Path.Combine(directory, fileName.RelativePath()); string filePath = Path.Combine(directory, fileName.RelativePath());
// 视频类别 // 视频类别

@ -138,7 +138,8 @@ namespace DownKyi.Services.Download
// 路径 // 路径
string[] temp = downloading.DownloadBase.FilePath.Split('/'); string[] temp = downloading.DownloadBase.FilePath.Split('/');
string path = downloading.DownloadBase.FilePath.Replace(temp[temp.Length - 1], ""); //string path = downloading.DownloadBase.FilePath.Replace(temp[temp.Length - 1], "");
string path = downloading.DownloadBase.FilePath.TrimEnd(temp[temp.Length - 1].ToCharArray());
// 下载文件名 // 下载文件名
string fileName = Guid.NewGuid().ToString("N"); string fileName = Guid.NewGuid().ToString("N");
@ -581,7 +582,9 @@ namespace DownKyi.Services.Download
{ {
// 路径 // 路径
string[] temp = downloading.DownloadBase.FilePath.Split('/'); string[] temp = downloading.DownloadBase.FilePath.Split('/');
string path = downloading.DownloadBase.FilePath.Replace(temp[temp.Length - 1], ""); //string path = downloading.DownloadBase.FilePath.Replace(temp[temp.Length - 1], "");
string path = downloading.DownloadBase.FilePath.TrimEnd(temp[temp.Length - 1].ToCharArray());
// 路径不存在则创建 // 路径不存在则创建
if (!Directory.Exists(path)) if (!Directory.Exists(path))
{ {

Loading…
Cancel
Save