openvidu-server: do NOT return uniqueSessionId when getting Recordings

pull/609/head
pabloFuente 2021-03-02 11:15:57 +01:00
parent b9e54e032a
commit a7918ba174
5 changed files with 14 additions and 11 deletions

View File

@ -191,7 +191,7 @@ public class Recording {
this.hasVideo = hasVideo;
}
public JsonObject toJson() {
public JsonObject toJson(boolean withUniqueSessionId) {
JsonObject json = new JsonObject();
json.addProperty("id", this.id);
json.addProperty("object", "recording");
@ -205,7 +205,9 @@ public class Recording {
}
}
json.addProperty("sessionId", this.sessionId);
if (withUniqueSessionId) {
json.addProperty("uniqueSessionId", this.uniqueSessionId);
}
json.addProperty("createdAt", this.createdAt);
json.addProperty("size", this.size);
json.addProperty("duration", this.duration);

View File

@ -79,7 +79,7 @@ public class ComposedQuickStartRecordingService extends ComposedRecordingService
envs.add("VIDEO_ID=" + recording.getId());
envs.add("VIDEO_NAME=" + properties.name());
envs.add("VIDEO_FORMAT=mp4");
envs.add("RECORDING_JSON='" + recording.toJson().toString() + "'");
envs.add("RECORDING_JSON='" + recording.toJson(true).toString() + "'");
String containerId = this.sessionsContainers.get(session.getSessionId());
try {

View File

@ -157,9 +157,9 @@ public class ComposedRecordingService extends RecordingService {
envs.add("VIDEO_ID=" + recording.getId());
envs.add("VIDEO_NAME=" + properties.name());
envs.add("VIDEO_FORMAT=mp4");
envs.add("RECORDING_JSON=" + recording.toJson().toString());
envs.add("RECORDING_JSON=" + recording.toJson(true).toString());
log.info(recording.toJson().toString());
log.info(recording.toJson(true).toString());
log.info("Recorder connecting to url {}", layoutUrl);
String containerId;

View File

@ -90,7 +90,7 @@ public abstract class RecordingService {
String filePath = this.openviduConfig.getOpenViduRecordingPath() + recording.getId() + "/"
+ RecordingService.RECORDING_ENTITY_FILE + recording.getId();
String text = recording.toJson().toString();
String text = recording.toJson(true).toString();
this.fileManager.createAndWriteFile(filePath, text);
log.info("Generated recording metadata file at {}", filePath);
}
@ -139,7 +139,7 @@ public abstract class RecordingService {
recording.setSize(size); // Size in bytes
recording.setDuration(duration > 0 ? duration : 0); // Duration in seconds
if (this.fileManager.overwriteFile(metadataFilePath, recording.toJson().toString())) {
if (this.fileManager.overwriteFile(metadataFilePath, recording.toJson(true).toString())) {
log.info("Sealed recording metadata file at {} with status [{}]", metadataFilePath, status.name());
}

View File

@ -377,7 +377,7 @@ public class SessionRestController {
try {
Recording startedRecording = this.recordingManager.startRecording(session, recordingProperties);
return new ResponseEntity<>(startedRecording.toJson().toString(), RestUtils.getResponseHeaders(),
return new ResponseEntity<>(startedRecording.toJson(false).toString(), RestUtils.getResponseHeaders(),
HttpStatus.OK);
} catch (OpenViduException e) {
HttpStatus status = e.getCodeValue() == Code.MEDIA_NODE_STATUS_WRONG.getValue()
@ -431,7 +431,7 @@ public class SessionRestController {
session.getParticipantByPublicId(ProtocolElements.RECORDER_PARTICIPANT_PUBLICID), null, null, null);
}
return new ResponseEntity<>(stoppedRecording.toJson().toString(), RestUtils.getResponseHeaders(),
return new ResponseEntity<>(stoppedRecording.toJson(false).toString(), RestUtils.getResponseHeaders(),
HttpStatus.OK);
}
@ -451,7 +451,8 @@ public class SessionRestController {
&& recordingManager.getStartingRecording(recording.getId()) != null) {
recording.setStatus(io.openvidu.java.client.Recording.Status.starting);
}
return new ResponseEntity<>(recording.toJson().toString(), RestUtils.getResponseHeaders(), HttpStatus.OK);
return new ResponseEntity<>(recording.toJson(false).toString(), RestUtils.getResponseHeaders(),
HttpStatus.OK);
} catch (Exception e) {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
@ -475,7 +476,7 @@ public class SessionRestController {
&& recordingManager.getStartingRecording(rec.getId()) != null) {
rec.setStatus(io.openvidu.java.client.Recording.Status.starting);
}
jsonArray.add(rec.toJson());
jsonArray.add(rec.toJson(false));
});
json.addProperty("count", recordings.size());
json.add("items", jsonArray);