Skip if file exists

This commit is contained in:
Changhua committed 2023-11-26 22:36:41 +08:00
1 parent ff2ca5fe15
commit 4dc6f34f23
1 file changed
+3
+3
View File
@@ -228,6 +228,9 @@ int DownloadAttach(uint64_t id, string thumb, string extra)
// 创建父目录,由于路径来源于微信,不做检查
fs::create_directory(fs::path(save_path).parent_path().string());
if (fs::exists(save_path)) { // 不重复下载
return 0;
}
wstring wsSavePath = String2Wstring(save_path);
wstring wsThumbPath = String2Wstring(thumb_path);