Skip to content

Commit

Permalink
SUP-22697:2.3: set redirect only if specify (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-winder-kaltura authored Aug 2, 2020
1 parent ea61c20 commit 68d73d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions lib/BackendClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,15 +385,17 @@ var BackendClient = (function(){
// 3) liveStream.registerMediaServer: Register entry in server with
// the last status received and get a new recordedEntryId.
/**********************************************/
function resetRecordingEntry(entryObj, allowRecordedEntryCreation) {
function resetRecordingEntry(entryObj, allowRecordedEntryCreation, resetRedirect) {
let deferred = Q.defer();
logger.debug(`[${entryObj.entryId}] Calling multiRequest for resetting recordedEntryID`);
client.startMultiRequest();
let KalturaMediaEntry = new kalturaVO.KalturaMediaEntry();
// liveStream.update parameter
KalturaMediaEntry.recordedEntryId = "";
KalturaMediaEntry.msDuration = 0;
KalturaMediaEntry.redirectEntryId = "";
if (resetRedirect) {
KalturaMediaEntry.redirectEntryId = "";
}
// entryServerNode.lise parameter
let EntryServerNodeFilter = new kalturaVO.KalturaLiveEntryServerNodeFilter();
EntryServerNodeFilter.entryIdEqual = entryObj.entryId;
Expand Down Expand Up @@ -664,11 +666,11 @@ var BackendClient = (function(){
});
};

BackendClient.resetRecordingEntry = function(entryObj, allowRecordedEntryCreation = true) {
BackendClient.resetRecordingEntry = function(entryObj, allowRecordedEntryCreation = true, resetRedirect = true) {
logger.debug(`[${entryObj.entryId}] reset recordedEntryId`);
return createSession()
.then(()=> {
return resetRecordingEntry(entryObj, allowRecordedEntryCreation);
return resetRecordingEntry(entryObj, allowRecordedEntryCreation, resetRedirect);
});
};

Expand Down
6 changes: 3 additions & 3 deletions lib/recording/RecordingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class RecordingManager {
}
if (isRecordingFinish(element)) {
const resetRecordedEntryId = (element.entryObject.recordStatus != kalturaTypes.KalturaRecordStatus.APPENDED);
this.stopRecording(entryId, resetRecordedEntryId);
this.stopRecording(entryId, resetRecordedEntryId, false);
}
});
logger.info("Available recording entry: %j", _.keys(this.recordingList));
Expand Down Expand Up @@ -321,7 +321,7 @@ class RecordingManager {
})
}

stopRecording(entryId, resetRecordedEntry = false) {
stopRecording(entryId, resetRecordedEntry = false, resetRedirect = true) {
if (this.recordingList[entryId]) {
let recordingEntrySession = this.recordingList[entryId];
if (!recordingEntrySession) {
Expand Down Expand Up @@ -378,7 +378,7 @@ class RecordingManager {
if (resetRecordedEntry && (entryObject.serverType == kalturaTypes.KalturaEntryServerNodeType.LIVE_PRIMARY))
{
recordingEntrySession.updateEntryDuration(true).then(()=>{
backendClient.resetRecordingEntry(entryObject, false);
backendClient.resetRecordingEntry(entryObject, false, resetRedirect);
});
}
return qio.write(doneFilePath, 'done');
Expand Down

0 comments on commit 68d73d9

Please sign in to comment.