mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-29 21:38:22 +08:00
确保deleteRecordDirectory接口忽略正在录制的mp4文件 (#3032)
This commit is contained in:
Submodule 3rdpart/ZLToolKit updated: 7a403274c3...f8471ab1e6
@@ -1547,20 +1547,21 @@ void installWebApi() {
|
|||||||
}
|
}
|
||||||
val["path"] = record_path;
|
val["path"] = record_path;
|
||||||
if (!recording) {
|
if (!recording) {
|
||||||
val["code"] = File::delete_file(record_path);
|
val["code"] = File::delete_file(record_path, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
File::scanDir(record_path, [](const string &path, bool is_dir) {
|
File::scanDir(record_path, [](const string &path, bool is_dir) {
|
||||||
if (is_dir) {
|
if (is_dir) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (path.find("./") != std::string::npos) {
|
if (path.find("/.") == std::string::npos) {
|
||||||
File::delete_file(path);
|
File::delete_file(path);
|
||||||
} else {
|
} else {
|
||||||
TraceL << "Ignore tmp mp4 file: " << path;
|
TraceL << "Ignore tmp mp4 file: " << path;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}, true);
|
}, true, true);
|
||||||
|
File::deleteEmptyDir(record_path);
|
||||||
});
|
});
|
||||||
|
|
||||||
//获取录像文件夹列表或mp4文件列表
|
//获取录像文件夹列表或mp4文件列表
|
||||||
|
|||||||
Reference in New Issue
Block a user