mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
deleteRecordDirectory接口新增name参数,可以指定删除特定录像文件
This commit is contained in:
parent
0f94b48823
commit
c1b82961cf
@ -1491,11 +1491,15 @@ void installWebApi() {
|
||||
// http://127.0.0.1/index/api/deleteRecordDirectroy?vhost=__defaultVhost__&app=live&stream=ss&period=2020-01-01
|
||||
api_regist("/index/api/deleteRecordDirectory", [](API_ARGS_MAP) {
|
||||
CHECK_SECRET();
|
||||
CHECK_ARGS("vhost", "app", "stream");
|
||||
CHECK_ARGS("vhost", "app", "stream", "period");
|
||||
auto tuple = MediaTuple{allArgs["vhost"], allArgs["app"], allArgs["stream"]};
|
||||
auto record_path = Recorder::getRecordPath(Recorder::type_mp4, tuple, allArgs["customized_path"]);
|
||||
auto period = allArgs["period"];
|
||||
record_path = record_path + period + "/";
|
||||
auto name = allArgs["name"];
|
||||
if (!name.empty()) {
|
||||
record_path += name;
|
||||
}
|
||||
int result = File::delete_file(record_path.data());
|
||||
if (result) {
|
||||
// 不等于0时代表失败
|
||||
|
Loading…
Reference in New Issue
Block a user