From b43863342b88b2c5dd6c3547ad77c48ca6122112 Mon Sep 17 00:00:00 2001 From: Daniel Petri Rocha Date: Tue, 22 Nov 2022 21:07:43 +0100 Subject: [PATCH] Add captured slides to UploadingPresentations collection --- .../PresentationWithAnnotationsMsgHdlr.scala | 2 +- .../api/breakouts/server/publishers.js | 1 + .../breakout-remaining-time/container.jsx | 2 +- .../ui/components/breakout-room/service.js | 49 +++++++++++-------- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationWithAnnotationsMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationWithAnnotationsMsgHdlr.scala index 288fe2968f..cb68d6ec08 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationWithAnnotationsMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationWithAnnotationsMsgHdlr.scala @@ -146,7 +146,7 @@ trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait { log.error(s"No presentation set in meeting ${meetingId}") } else { - val jobId: String = RandomStringGenerator.randomAlphanumericString(16); + val jobId: String = s"${meetingId}-slides" // Used as the temporaryPresentationId upon upload val jobType = "PresentationWithAnnotationExportJob" val allPages: Boolean = m.allPages val pageCount = currentPres.get.pages.size diff --git a/bigbluebutton-html5/imports/api/breakouts/server/publishers.js b/bigbluebutton-html5/imports/api/breakouts/server/publishers.js index 5bae51873b..f2cbc5ce7e 100755 --- a/bigbluebutton-html5/imports/api/breakouts/server/publishers.js +++ b/bigbluebutton-html5/imports/api/breakouts/server/publishers.js @@ -33,6 +33,7 @@ function breakouts() { shortName: 1, timeRemaining: 1, captureNotes: 1, + captureSlides: 1, }, }; diff --git a/bigbluebutton-html5/imports/ui/components/breakout-room/breakout-remaining-time/container.jsx b/bigbluebutton-html5/imports/ui/components/breakout-room/breakout-remaining-time/container.jsx index 39786f88c3..3680fe352c 100644 --- a/bigbluebutton-html5/imports/ui/components/breakout-room/breakout-remaining-time/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/breakout-room/breakout-remaining-time/container.jsx @@ -147,7 +147,7 @@ export default injectNotify(injectIntl(withTracker(({ if (fromBreakoutPanel) data.bold = true; } else { clearInterval(timeRemainingInterval); - BreakoutService.setCapturedNotesUploading(); + BreakoutService.setCapturedContentUploading(); data.message = intl.formatMessage(timeEndedMessage || intlMessages.breakoutWillClose); } } else if (breakoutRoom) { diff --git a/bigbluebutton-html5/imports/ui/components/breakout-room/service.js b/bigbluebutton-html5/imports/ui/components/breakout-room/service.js index 6480b7c52f..50aa6a7450 100644 --- a/bigbluebutton-html5/imports/ui/components/breakout-room/service.js +++ b/bigbluebutton-html5/imports/ui/components/breakout-room/service.js @@ -38,35 +38,42 @@ const getBreakoutRoomUrl = (breakoutId) => { return breakoutUrlData; }; -const setCapturedNotesUploading = () => { +const upsertCapturedContent = (filename, temporaryPresentationId) => { + UploadingPresentations.upsert({ + temporaryPresentationId, + }, { + $set: { + id: _.uniqueId(filename), + temporaryPresentationId, + progress: 0, + filename, + lastModifiedUploader: false, + upload: { + done: false, + error: false, + }, + uploadTimestamp: new Date(), + }, + }); +}; + +const setCapturedContentUploading = () => { const breakoutRooms = findBreakouts(); breakoutRooms.forEach((breakout) => { + const filename = breakout.shortName; + const temporaryPresentationId = breakout.breakoutId; if (breakout.captureNotes) { - const filename = breakout.shortName; - const temporaryPresentationId = `${breakout.breakoutId}-notes`; + upsertCapturedContent(filename, `${temporaryPresentationId}-notes`); + } - UploadingPresentations.upsert({ - temporaryPresentationId, - }, { - $set: { - id: _.uniqueId(filename), - temporaryPresentationId, - progress: 0, - filename, - lastModifiedUploader: false, - upload: { - done: false, - error: false, - }, - uploadTimestamp: new Date(), - }, - }); + if (breakout.captureSlides) { + upsertCapturedContent(filename, `${temporaryPresentationId}-slides`); } }); }; const endAllBreakouts = () => { - setCapturedNotesUploading(); + setCapturedContentUploading(); makeCall('endAllBreakouts'); }; @@ -244,5 +251,5 @@ export default { sortUsersByName: UserListService.sortUsersByName, isUserInBreakoutRoom, checkInviteModerators, - setCapturedNotesUploading, + setCapturedContentUploading, };