Add sequence number to exported PDFs

This commit is contained in:
Daniel Petri Rocha 2022-05-04 18:45:04 +02:00
parent c2db1575a4
commit 48f05962a0
2 changed files with 11 additions and 1 deletions

View File

@ -153,7 +153,14 @@ trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait {
val presentationUploadToken: String = PresentationPodsApp.generateToken("DEFAULT_PRESENTATION_POD", userId)
val jobId = RandomStringGenerator.randomAlphanumericString(16)
val filename: String = s"${liveMeeting.props.meetingProp.name}-annotated"
// Set filename, checking if it is already in use
var filename: String = liveMeeting.props.meetingProp.name
val duplicatedCount = presentationPods.flatMap(_.getPresentationsByFilename(filename)).size
filename = duplicatedCount match {
case 0 => filename
case _ => s"${filename}(${duplicatedCount})"
}
// Informs bbb-web about the token so that when we use it to upload the presentation, it is able to look it up in the list of tokens
bus.outGW.send(buildPresentationUploadTokenSysPubMsg(parentMeetingId, userId, presentationUploadToken, filename))

View File

@ -83,6 +83,9 @@ case class PresentationPod(id: String, currentPresenter: String,
def getPresentation(presentationId: String): Option[PresentationInPod] =
presentations.values find (p => p.id == presentationId)
def getPresentationsByFilename(filename: String): Iterable[PresentationInPod] =
presentations.values filter (p => p.name.startsWith(filename))
def setCurrentPresentation(presId: String): Option[PresentationPod] = {
var tempPod: PresentationPod = this
presentations.values foreach (curPres => { // unset previous current presentation