Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/CHKZL/DDTV2
Browse files Browse the repository at this point in the history
  • Loading branch information
CHKZL committed Mar 26, 2021
2 parents 7ca63fc + 0ac238e commit 5df25b1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Auxiliary/Downloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public static Downloader 新建下载对象(string 平台, string 唯一码, str
if (MMPU.下载储存目录 == 缓存路径)
{
保存路径 = 缓存路径 + 平台 + "_" + 主播名称 + "_" + 唯一码 + "/";
if (Directory.Exists(保存路径))//如果不存在就创建文件夹
if (!Directory.Exists(保存路径))//如果不存在就创建文件夹
{
Directory.CreateDirectory(保存路径);
}
Expand Down
13 changes: 12 additions & 1 deletion Auxiliary/MMPU.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ public static bool 配置文件初始化(int 模式)
InfoLog.InfoPrintf($"配置文件初始化任务[RoomConfigFile]:{RoomInit.RoomConfigFile}", InfoLog.InfoClass.Debug);
//房间配置文件
MMPU.下载储存目录 = MMPU.读取exe默认配置文件("file", "./tmp/");
if(Directory.Exists("./tmp"))
CheckPath(ref MMPU.下载储存目录);
if (!Directory.Exists("./tmp"))
{
Directory.CreateDirectory("./tmp");
}
Expand Down Expand Up @@ -1643,5 +1644,15 @@ internal static class WinApi
public static extern IntPtr GetProcAddress(IntPtr handle, string funcname);
}
}
/// <summary>
/// 检查路径末尾分隔符并修正
/// </summary>
/// <param name="x">待检查修改路径</param>
/// <returns>无返回</returns>
private static void CheckPath(ref string x)
{
if (x.Substring(x.Length - 1, 1) != "/" && x.Substring(x.Length - 1, 1) != "\\") x += '/';
return;
}
}
}

0 comments on commit 5df25b1

Please sign in to comment.