From 56db28c9135f5f6bb245b9ccc2dfdc6041879b7b Mon Sep 17 00:00:00 2001 From: croire <1432593898@qq.com> Date: Sat, 19 Mar 2022 17:00:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A7=86=E9=A2=91=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E5=92=8C=E5=88=86P=E6=A0=87=E9=A2=98=E7=9B=B8?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E6=89=BE=E4=B8=8D=E5=88=B0=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DownKyi/Services/Download/AddToDownloadService.cs | 2 +- DownKyi/Services/Download/AriaDownloadService.cs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/DownKyi/Services/Download/AddToDownloadService.cs b/DownKyi/Services/Download/AddToDownloadService.cs index f6d1273..09d89d6 100644 --- a/DownKyi/Services/Download/AddToDownloadService.cs +++ b/DownKyi/Services/Download/AddToDownloadService.cs @@ -302,7 +302,7 @@ namespace DownKyi.Services.Download .SetBvid(page.Bvid) .SetCid(page.Cid) .SetUpMid(page.Owner.Mid) - .SetUpName(page.Owner.Name); + .SetUpName(Format.FormatFileName(page.Owner.Name)); string filePath = Path.Combine(directory, fileName.RelativePath()); // 视频类别 diff --git a/DownKyi/Services/Download/AriaDownloadService.cs b/DownKyi/Services/Download/AriaDownloadService.cs index ff5d656..ef03104 100644 --- a/DownKyi/Services/Download/AriaDownloadService.cs +++ b/DownKyi/Services/Download/AriaDownloadService.cs @@ -138,7 +138,8 @@ namespace DownKyi.Services.Download // 路径 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"); @@ -581,7 +582,9 @@ namespace DownKyi.Services.Download { // 路径 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)) {