From c1b82961cf3e135eb1cab39184e47e4a408ed1f5 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Sat, 28 Oct 2023 10:22:43 +0800 Subject: [PATCH] =?UTF-8?q?deleteRecordDirectory=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=96=B0=E5=A2=9Ename=E5=8F=82=E6=95=B0=EF=BC=8C=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=8C=87=E5=AE=9A=E5=88=A0=E9=99=A4=E7=89=B9=E5=AE=9A?= =?UTF-8?q?=E5=BD=95=E5=83=8F=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/WebApi.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 7c8e35c0..784782b9 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -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时代表失败