优化快照的存储与显示

This commit is contained in:
648540858
2022-06-02 10:55:41 +08:00
parent 936adf31fe
commit 9ae0691c80
5 changed files with 63 additions and 57 deletions

View File

@@ -91,10 +91,9 @@ public class ZLMHttpHookListener {
public ResponseEntity<String> onServerKeepalive(@RequestBody JSONObject json){
if (logger.isDebugEnabled()) {
logger.debug("[ ZLM HOOK ]on_server_keepalive API调用参数" + json.toString());
logger.debug("[ ZLM HOOK ] on_server_keepalive API调用参数" + json.toString());
}
String mediaServerId = json.getString("mediaServerId");
List<ZLMHttpHookSubscribe.Event> subscribes = this.subscribe.getSubscribes(ZLMHttpHookSubscribe.HookType.on_server_keepalive);
if (subscribes != null && subscribes.size() > 0) {
for (ZLMHttpHookSubscribe.Event subscribe : subscribes) {
@@ -164,7 +163,6 @@ public class ZLMHttpHookListener {
if (mediaInfo != null) {
subscribe.response(mediaInfo, json);
}
}
JSONObject ret = new JSONObject();
ret.put("code", 0);

View File

@@ -151,7 +151,7 @@ public class ZLMRESTfulUtils {
}
}
File snapFile = new File(targetPath + "/" + fileName);
File snapFile = new File(targetPath + File.separator + fileName);
FileOutputStream outStream = new FileOutputStream(snapFile);
outStream.write(Objects.requireNonNull(response.body()).bytes());